Skip to content

Commit

Permalink
Add ability to not add health check task to celery beat schedule (#133)
Browse files Browse the repository at this point in the history
* Add ability to not add health check task to celery beat schedule

* bump shared version

Signed-off-by: joseph-sentry <[email protected]>
  • Loading branch information
joseph-sentry committed Oct 10, 2023
1 parent 0ff20ab commit 33030c4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
16 changes: 9 additions & 7 deletions celery_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,6 @@ def _beat_schedule():
"cron_task_generation_time_iso": BeatLazyFunc(get_utc_now_as_iso_format)
},
},
"health_check_task": {
"task": health_check_task_name,
"schedule": timedelta(seconds=get_health_check_interval_seconds()),
"kwargs": {
"cron_task_generation_time_iso": BeatLazyFunc(get_utc_now_as_iso_format)
},
},
"github_app_webhooks_task": {
"task": gh_app_webhook_check_task_name,
"schedule": crontab(minute="0", hour="0,6,12,18"),
Expand All @@ -139,6 +132,15 @@ def _beat_schedule():
},
}

if get_config("setup", "health_check", "enabled", default=False):
beat_schedule["health_check_task"] = {
"task": health_check_task_name,
"schedule": timedelta(seconds=get_health_check_interval_seconds()),
"kwargs": {
"cron_task_generation_time_iso": BeatLazyFunc(get_utc_now_as_iso_format)
},
}

if get_config("setup", "telemetry", "enabled", default=True):
beat_schedule["brolly_stats_rollup"] = {
"task": brolly_stats_rollup_task_name,
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
https://github.com/codecov/shared/archive/a4ccbbb66eef572719bf8f522b5c8805c72297a9.tar.gz#egg=shared
https://github.com/codecov/shared/archive/36cea1a0ec45a333fbbd0b89ae1ca3860e17e6d1.tar.gz#egg=shared
https://github.com/codecov/opentelem-python/archive/refs/tags/v0.0.4a1.tar.gz#egg=codecovopentelem
boto3
celery
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile requirements.in
Expand Down Expand Up @@ -120,6 +120,7 @@ grpcio==1.58.0
# via
# google-api-core
# google-cloud-pubsub
# googleapis-common-protos
# grpc-google-iam-v1
# grpcio-status
grpcio-status==1.58.0
Expand Down Expand Up @@ -283,7 +284,7 @@ s3transfer==0.3.4
# via boto3
sentry-sdk==1.19.1
# via -r requirements.in
shared @ https://github.com/codecov/shared/archive/a4ccbbb66eef572719bf8f522b5c8805c72297a9.tar.gz
shared @ https://github.com/codecov/shared/archive/36cea1a0ec45a333fbbd0b89ae1ca3860e17e6d1.tar.gz
# via -r requirements.in
six==1.15.0
# via
Expand Down

0 comments on commit 33030c4

Please sign in to comment.