Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/DWPF-734-swap-edit-page-moj-side…
Browse files Browse the repository at this point in the history
…-nav-to-search-nav' into DWPF-734-swap-edit-page-moj-side-nav-to-search-nav
  • Loading branch information
nicopicchio committed Sep 12, 2023
2 parents 08b350d + 9994071 commit 33e5331
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/peoplefinder/services/person.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
10 changes: 8 additions & 2 deletions src/peoplefinder/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

0 comments on commit 33e5331

Please sign in to comment.