Skip to content

Commit

Permalink
Merge pull request #164 from uktrade/feature/increase-timeout
Browse files Browse the repository at this point in the history
fix: reorder cache-building tasks and extend Celery task time limit
  • Loading branch information
hareshkainthdbt authored Jan 20, 2025
2 parents 0198ad2 + ca5be56 commit ea9ca58
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion celery_worker/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def rebuild_cache():
start = time.time()
clear_all_documents()
config = SearchDocumentConfig(search_query="", timeout=2)
Legislation().build_cache(config)
PublicGateway().build_cache(config)
Legislation().build_cache(config)
end = time.time()
message = {
"message": "rebuilt cache",
Expand Down
2 changes: 1 addition & 1 deletion fbr/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers.DatabaseScheduler"
CELERY_RESULT_EXTENDED = True
CELERY_TASK_TIME_LIMIT = (
1800 # Maximum runtime for a task in seconds (e.g., 1800/60 = 30 minutes)
3600 # Maximum runtime for a task in seconds (e.g., 3600/60 = 60 minutes)
)
CELERY_TASK_SOFT_TIME_LIMIT = (
270 # Optional: Grace period before forced termination
Expand Down

0 comments on commit ea9ca58

Please sign in to comment.