Skip to content

Commit 9ccb575

Browse files
explicitly start the stopped cron service on the running API in the post deploy hook
1 parent 83f4330 commit 9ccb575

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

infrastructure/deploy.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,14 @@ def post_deploy_hook(terraform_output: dict):
240240
except subprocess.CalledProcessError:
241241
return 1
242242

243+
# Explicitly start the cron service to handle the case where the same API,
244+
# which had its cron service stopped during the pre deploy hook, is still running here
245+
try:
246+
run_remote_command(api_ip_address, "sudo systemctl start cron")
247+
except subprocess.CalledProcessError:
248+
print("There was an error starting the cron service.")
249+
return 1
250+
243251
return 0
244252

245253

0 commit comments

Comments
 (0)