Skip to content

Commit

Permalink
fix after victor's comments 2
Browse files Browse the repository at this point in the history
  • Loading branch information
hlecuyer committed Aug 29, 2024
1 parent 170e8e8 commit bbef4b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions api/cron.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"jobs": [
{
"command": "30 * * * * TQDM_DISABLE=1 test $ENV = 'prod' && sh run_management_command.sh data-inclusion-api load_inclusion_data",
"command": "30 * * * * TQDM_DISABLE=1 test $ENV = 'prod' && sh execute_and_notify.sh data-inclusion-api load_inclusion_data",
"size": "XL"
},
{
"command": "30 * * * * TQDM_DISABLE=1 test $ENV != 'prod' && sh run_management_command.sh data-inclusion-api load_inclusion_data",
"command": "30 * * * * TQDM_DISABLE=1 test $ENV != 'prod' && data-inclusion-api load_inclusion_data",
"size": "S"
},
{
"command": "0 4 * * * sh run_management_command.sh vacuumdb --full --analyze --verbose --table api__structures --table api__services $DATABASE_URL",
"command": "0 4 * * * sh execute_and_notify.sh vacuumdb --full --analyze --verbose --table api__structures --table api__services $DATABASE_URL",
"size": "S"
}
]
Expand Down
1 change: 0 additions & 1 deletion api/execute_and_notify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ wait $command_pid

exit_code=$?
if [ $exit_code -ne 0 ] && [ "$ENV" = "prod" ]; then
# Execute the curl command in case of an error
escaped_command="\`$@\`"
echo "Error with exit code \`$exit_code\` in command $escaped_command, sending message to Mattermost"
curl -i -X POST -H "Content-Type: application/json" -d "{\"text\": \"Error with exit code \`$exit_code\` in command $escaped_command: \nLogs: \`scalingo --region osc-secnum-fr1 --app data-inclusion-api-prod logs --lines 1000 -F $CONTAINER -f\`\"}" $MATTERMOST_HOOK
Expand Down

0 comments on commit bbef4b3

Please sign in to comment.