Skip to content

Commit 1cc8eef

Browse files
committed
Multi-thread complete
1 parent 7fee268 commit 1cc8eef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

assemblyline_core/ingester/ingester.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
_retry_delay = 60 * 4 # Wait 4 minutes to retry
5050
_max_time = 2 * 24 * 60 * 60 # Wait 2 days for responses.
5151
HOUR_IN_SECONDS = 60 * 60
52+
COMPLETE_THREADS = int(environ.get('INGESTER_COMPLETE_THREADS', 4))
5253
INGEST_THREADS = int(environ.get('INGESTER_INGEST_THREADS', 1))
5354
SUBMIT_THREADS = int(environ.get('INGESTER_SUBMIT_THREADS', 4))
5455

@@ -223,10 +224,10 @@ def __init__(self, datastore=None, logger=None, classification=None, redis=None,
223224

224225
def try_run(self):
225226
threads_to_maintain = {
226-
'Complete': self.handle_complete,
227227
'Retries': self.handle_retries,
228228
'Timeouts': self.handle_timeouts
229229
}
230+
threads_to_maintain.update({f'Complete_{n}': self.handle_complete for n in range(COMPLETE_THREADS)})
230231
threads_to_maintain.update({f'Ingest_{n}': self.handle_ingest for n in range(INGEST_THREADS)})
231232
threads_to_maintain.update({f'Submit_{n}': self.handle_submit for n in range(SUBMIT_THREADS)})
232233
self.maintain_threads(threads_to_maintain)

0 commit comments

Comments
 (0)