Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
wbaccinelli committed Jul 13, 2023
1 parent b7ec026 commit a187948
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scheduler/celery_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def setup_periodic_tasks(sender, **kwargs): # pylint: disable=unused-argument
and for the dialogs status check are started
"""
# notify the FSM that a new day started
sender.add_periodic_task(crontab(hour=00, minute=00), notify_new_day.s())
sender.add_periodic_task(crontab(hour=6, minute=00), notify_new_day.s())
# check if the user is active and send notification
sender.add_periodic_task(crontab(hour=10, minute=00), check_inactivity.s())
# check if a dialog has been completed
Expand Down
7 changes: 7 additions & 0 deletions scheduler/state_machine/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,13 @@ def on_user_trigger(self, dialog: str):
dialog=dialog,
phase_id=1)

def on_dialog_completed(self, dialog):
logging.info('A dialog has been completed %s ', dialog)

store_completed_dialog(user_id=self.user_id,
dialog=dialog,
phase_id=2)

def check_if_end_date(self, current_date: date):
quit_date = get_quit_date(self.user_id)
if current_date >= quit_date:
Expand Down

0 comments on commit a187948

Please sign in to comment.