[downloader] Fix log message and close shared memory on exit

This commit is contained in:
derrod 2020-04-21 20:26:17 +02:00
parent 04cc72d154
commit 78d745b03f

View file

@ -42,7 +42,7 @@ class DLWorker(Process):
continue continue
if job.kill: # let worker die if job.kill: # let worker die
self.log.info(f'[{self.name}] Queue Empty, waiting for more...') self.log.info(f'[{self.name}] Worker received kill signal, shutting down...')
break break
tries = 0 tries = 0
@ -99,6 +99,8 @@ class DLWorker(Process):
self.o_q.put(DownloaderTaskResult(success=False, chunk_guid=job.guid, shm=job.shm, url=job.url)) self.o_q.put(DownloaderTaskResult(success=False, chunk_guid=job.guid, shm=job.shm, url=job.url))
continue continue
self.shm.close()
class FileWorker(Process): class FileWorker(Process):
def __init__(self, queue, out_queue, base_path, shm, cache_path=None): def __init__(self, queue, out_queue, base_path, shm, cache_path=None):