openwisp / openwisp-notifications

Notifications module of OpenWISP
https://openwisp.io/docs/dev/notifications/
GNU General Public License v3.0
40 stars 41 forks source link

[change] Add celery time limits to tasks #217

Closed nemesifier closed 2 years ago

nemesifier commented 2 years ago

Depends on https://github.com/openwisp/openwisp-utils/issues/271.

Let's ensure all tasks have time limits defined. For similar tasks we may share the same settings.

dishantsethi commented 2 years ago

I'll be working on this. @nemesisdesign What should be the time_limit for celery tasks? By default, tasks don’t time out. So, should I set some large global default timeout for tasks and override in specific tasks?

For example:

In settings.py

CELERYD_TASK_SOFT_TIME_LIMIT = 60

In tasks.py

@shared_task(soft_time_limit=5)
def func():

Also, Is retrying required in case of task failure or exception.

nemesifier commented 2 years ago

@dishantsethi this issue depends on https://github.com/openwisp/openwisp-utils/issues/271, on which @pandafy is working on.