refactor(queueworker): remove unused function and import

Remove `_close_db_handle` method from `QueueWorker` class. Nowhere
calls this method, so it is safe to remove. This function was the
only place using the `db` imported from `data.model`, so we can
remove that import as well.

Testing: need to look into it
This commit is contained in:
EvB 2017-07-10 10:49:39 -04:00
parent a3afd37c41
commit 6e2fad2b9c

View file

@ -4,7 +4,6 @@ import json
from threading import Event, Lock from threading import Event, Lock
from app import app from app import app
from data.model import db
from data.database import CloseForLongOperation from data.database import CloseForLongOperation
from workers.worker import Worker from workers.worker import Worker
@ -57,11 +56,6 @@ class QueueWorker(Worker):
""" Function that gets run once every watchdog_period_seconds. """ """ Function that gets run once every watchdog_period_seconds. """
pass pass
def _close_db_handle(self):
if not db.is_closed():
logger.debug('Disconnecting from database.')
db.close()
def extend_processing(self, seconds_from_now, updated_data=None): def extend_processing(self, seconds_from_now, updated_data=None):
with self._current_item_lock: with self._current_item_lock:
if self.current_queue_item is not None: if self.current_queue_item is not None: