diff --git a/src/peoplefinder/services/person.py b/src/peoplefinder/services/person.py index d6b476e92..0b81d429a 100644 --- a/src/peoplefinder/services/person.py +++ b/src/peoplefinder/services/person.py @@ -353,12 +353,14 @@ def trigger_profile_change_notification( return + countdown = 300 # 5 minutes. notify_user_about_profile_changes.apply_async( args=( person.pk, personalisation, + countdown, ), - countdown=300, # 5 minutes. + countdown=countdown, ) def notify_about_changes_debounce( diff --git a/src/peoplefinder/tasks.py b/src/peoplefinder/tasks.py index 0940bf807..991b754b1 100644 --- a/src/peoplefinder/tasks.py +++ b/src/peoplefinder/tasks.py @@ -37,11 +37,17 @@ def person_update_notifier(person_id): @celery_app.task(bind=True) -def notify_user_about_profile_changes(self, person_pk, personalisation): +def notify_user_about_profile_changes(self, person_pk, personalisation, countdown=None): from peoplefinder.services.person import PersonService + print( + "Running: notify_user_about_profile_changes\n" + f" - person_pk: {person_pk}\n" + f" - countdown: {countdown}\n" + ) + PersonService().notify_about_changes_debounce( person_pk=person_pk, personalisation=personalisation, - countdown=self.request.kwargs.get("countdown"), + countdown=countdown, )