Skip to content

Commit 806eb40

Browse files
committed
Keep cron result for 2 minutes so it persists during job teardown
1 parent aaa8d5e commit 806eb40

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/mavedb/worker/settings.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
from concurrent import futures
3+
from datetime import timedelta
34
from typing import Callable
45

56
from arq.connections import RedisSettings
@@ -26,7 +27,13 @@
2627
# In UTC time. Depending on daylight savings time, this will bounce around by an hour but should always be very early in the morning
2728
# for all of the USA.
2829
BACKGROUND_CRONJOBS: list[CronJob] = [
29-
cron(refresh_materialized_views, name="refresh_all_materialized_views", hour=20, minute=0)
30+
cron(
31+
refresh_materialized_views,
32+
name="refresh_all_materialized_views",
33+
hour=20,
34+
minute=0,
35+
keep_result=timedelta(minutes=2).total_seconds(),
36+
)
3037
]
3138

3239
REDIS_IP = os.getenv("REDIS_IP") or "localhost"

0 commit comments

Comments
 (0)