From 1c2814f58492ce7d3885856094d961188eb0b92b Mon Sep 17 00:00:00 2001 From: Victoria Earl Date: Fri, 1 Nov 2024 15:04:13 -0400 Subject: [PATCH] Fix health check restarts Completely removes the celery part of our health check to fix an issue where Celery being slow was causing a restart loop. --- uber/site_sections/devtools.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/uber/site_sections/devtools.py b/uber/site_sections/devtools.py index 54e871a5b..303e10e0f 100644 --- a/uber/site_sections/devtools.py +++ b/uber/site_sections/devtools.py @@ -242,24 +242,10 @@ def health(self, session): session.execute(text('SELECT 1')) db_read_time += time.perf_counter() - if os.environ.get("ENABLE_CELERY", "true").lower() == "true": - payload = random.randrange(1024) - task_run_time = -time.perf_counter() - response = ping.delay(payload).wait(timeout=2) - task_run_time += time.perf_counter() - else: - task_run_time = 0 - payload = "Not Run, ENABLE_CELERY != true" - response = "Not Run, ENABLE_CELERY != true" - return json.dumps({ 'server_current_timestamp': int(datetime.utcnow().timestamp()), 'session_read_count': read_count, 'session_commit_time': session_commit_time, 'db_read_time': db_read_time, 'db_status': Session.engine.pool.status(), - 'task_run_time': task_run_time, - 'task_response_correct': payload == response, - 'task_payload': payload, - 'task_response': response, })