Skip to content

Commit

Permalink
Merge pull request #96 from cloudblue/fix/LITE-25353
Browse files Browse the repository at this point in the history
LITE-25353 Fix of process termination in cqrs_consume
  • Loading branch information
maxipavlovic authored Nov 18, 2022
2 parents 6d20cd7 + dfce4bf commit e4305c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dj_cqrs/management/commands/cqrs_consume.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright © 2021 Ingram Micro Inc. All rights reserved.
# Copyright © 2022 Ingram Micro Inc. All rights reserved.
import multiprocessing
import signal

Expand Down Expand Up @@ -31,7 +31,9 @@ def start(self):

def terminate(self, *args, **kwargs):
while self.pool:
self.pool.pop().terminate()
p = self.pool.pop()
p.terminate()
p.join()

def reload(self, *args, **kwargs):
self.terminate()
Expand Down Expand Up @@ -73,8 +75,6 @@ def start_workers_pool(self, options):

signal.signal(signal.SIGHUP, workers_manager.reload)

signal.signal(signal.SIGINT, workers_manager.terminate)
signal.signal(signal.SIGTERM, workers_manager.terminate)
workers_manager.start()

def get_consume_kwargs(self, options):
Expand Down

0 comments on commit e4305c4

Please sign in to comment.