elixir-luxembourg / daisy

Data Information System (DAISY) is a data bookkeeping application designed to help Biomedical Research institutions with their GDPR compliance.
GNU Affero General Public License v3.0
12 stars 10 forks source link

#470 Notification Task and Logic #475

Closed HesamKorki closed 7 months ago

HesamKorki commented 8 months ago

Related to #470

Please first apply the migration and then proceed. You can create the celery task from the admin view and test it with periodic tasks.

neoflex commented 7 months ago

logging could be made more extensive. can be done in a futur improvement too. the output I got when nothing was generated:

[2023-11-09 16:00:34,553: INFO/ForkPoolWorker-6] Creating notifications for 2023-11-09 [2023-11-09 16:00:34,671: INFO/ForkPoolWorker-6] Task notification.tasks.create_notifications_for_entities[507437a6-b7d1-4778-ba21-d5be9ca61a01] succeeded in 0.12050887499935925s: None

neoflex commented 7 months ago

it would be worth modifying the settings_locale template to update the CELERY_BEAT_SCHEDULE including the new task. Also to make sure the recommended schedule executes this task before the email sending task.

HesamKorki commented 7 months ago

logging could be made more extensive. can be done in a futur improvement too. the output I got when nothing was generated:

[2023-11-09 16:00:34,553: INFO/ForkPoolWorker-6] Creating notifications for 2023-11-09 [2023-11-09 16:00:34,671: INFO/ForkPoolWorker-6] Task notification.tasks.create_notifications_for_entities[507437a6-b7d1-4778-ba21-d5be9ca61a01] succeeded in 0.12050887499935925s: None

I added some more logging at the Notification object creation time