Skip to content

Commit

Permalink
Merge pull request #59 from cuda-networks/fix_signal_bug
Browse files Browse the repository at this point in the history
Fix signal bug
  • Loading branch information
alexeyts authored Nov 14, 2020
2 parents be1f73c + ddc5127 commit ef17a05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eb_sqs/worker/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def __init__(self):
def process_queues(self, queue_names):
# type: (list) -> None
signal.signal(signal.SIGTERM, self._exit_called)
signal.signal(signal.SIGKILL, self._exit_called)

self.write_healthcheck_file()
self._last_healthcheck_time = timezone.now()
Expand Down Expand Up @@ -191,5 +190,6 @@ def write_healthcheck_file(self):
with open(settings.HEALTHCHECK_FILE_NAME, 'w') as file:
file.write(timezone.now().isoformat())

def _exit_called(self):
def _exit_called(self, signum, frame):
logger.info('[django-eb-sqs] Termination signal called: {}'.format(signum))
self._exit_gracefully = True

0 comments on commit ef17a05

Please sign in to comment.