X-Git-Url: http://git.treefish.org/~alex/photosort.git/blobdiff_plain/f74cea71b4539995483ec2393f22d7592d03632b..6d44902ddae12804578e256a93b593430ec75cb9:/src/bunch.py diff --git a/src/bunch.py b/src/bunch.py index 228131a..2b98734 100644 --- a/src/bunch.py +++ b/src/bunch.py @@ -1,4 +1,5 @@ import logging +import os import time import threading @@ -23,7 +24,8 @@ class Bunch: source_idx, DirTrigger(src_dir_cfg['path'], src_dir_cfg['cool_time'], src_dir_cfg['max_time']), - Migrator(src_dir_cfg['path'], cfg['dst_dir']['path']), + Migrator(src_dir_cfg['path'], cfg['dst_dir']['path'], + os.path.join(cfg['cache_dir'], "%d.db" % idx)), src_dir_cfg['cleanup'] ) ) @@ -40,6 +42,8 @@ class Bunch: logging.info("Stopping bunch #%d...", self._idx) self._stop = True self._worker_thread.join() + for src in self._sources: + src.migrator.close() logging.info("Stopped bunch #%d.", self._idx) def is_running(self):