Skip to content

Commit

Permalink
Merge pull request #52 from Moesif/refactor-exit-handler
Browse files Browse the repository at this point in the history
Refactor: Remove job from the scheduler
  • Loading branch information
dkm199 committed Feb 19, 2021
2 parents c609581 + e377d62 commit a15f5aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions moesifdjango/job_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ def __init__(self):
@classmethod
def exit_handler(cls, scheduler, debug):
try:
# Shut down the scheduler
# Remove job and shut down the scheduler
scheduler.remove_job('moesif_events_batch_job')
scheduler.shutdown()
except:
except Exception as ex:
if debug:
print("Error while closing the queue or scheduler shut down")
print(str(ex))

def send_events(self, api_client, batch_events, debug):
try:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='2.0.0',
version='2.0.1',

description='Moesif Middleware for Python Django',
long_description=long_description,
Expand Down

0 comments on commit a15f5aa

Please sign in to comment.