Skip to content

Commit 0d90ca0

Browse files
authored
Set new singleton_send_instant_notifications_summary_by_email limits (baserow#4798)
1 parent 5d65427 commit 0d90ca0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

backend/src/baserow/config/settings/base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,10 @@
180180
"baserow.contrib.database.table.tasks.run_row_count_job": {"queue": "export"},
181181
"baserow.core.jobs.tasks.clean_up_jobs": {"queue": "export"},
182182
}
183-
CELERY_TASK_SOFT_TIME_LIMIT = 60 * 5 # 5 minutes
184-
CELERY_TASK_TIME_LIMIT = CELERY_TASK_SOFT_TIME_LIMIT + 60 # 60 seconds
183+
CELERY_TASK_SOFT_TIME_LIMIT = int(
184+
os.getenv("CELERY_TASK_SOFT_TIME_LIMIT") or 60 * 5
185+
) # default 5 minutes
186+
CELERY_TASK_TIME_LIMIT = CELERY_TASK_SOFT_TIME_LIMIT + 60 # default 6 minutes
185187

186188
CELERY_REDBEAT_REDIS_URL = REDIS_URL
187189
# Explicitly set the same value as the default loop interval here so we can use it

backend/src/baserow/core/notifications/tasks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ def beat_send_instant_notifications_summary_by_email(self):
113113
bind=True,
114114
queue="export",
115115
raise_on_duplicate=True,
116-
lock_expiry=60 * 5,
116+
lock_expiry=settings.CELERY_TASK_TIME_LIMIT * 2,
117+
time_limit=settings.CELERY_TASK_TIME_LIMIT * 2,
117118
)
118119
def singleton_send_instant_notifications_summary_by_email(self):
119120
send_instant_notifications_email_to_users()

0 commit comments

Comments
 (0)