Skip to content

Commit

Permalink
fix refcount
Browse files Browse the repository at this point in the history
  • Loading branch information
ludamad committed Apr 13, 2024
1 parent 62d2138 commit e6e779b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ec2/userdata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export class UserData {
// Shutdown rules:
// - github actions job starts and ends always bump +ec2InstanceTtl minutes
// - when the amount of started jobs (start_run_* files) equal the amount of finished jobs (end_run_* files), we shutdown in 5 minutes
`echo "${bumpShutdown}; touch /run/shutdown-refcount/start_run_$(date +%s)_$RANDOM" > /run/delay_shutdown.sh`,
`echo "[ $(find /run/shutdown-refcount/ -name 'start_run_*' | wc -l) -eq $(find /run/shutdown-refcount/ -name 'end_run_*' | wc -l) ] && shutdown -P 5" > /run/if_refcount0_shutdown.sh`,
`echo "${bumpShutdown}; touch /run/shutdown-refcount/end_run_$(date +%s)_$RANDOM ; /run/if_refcount0_shutdown.sh " > /run/refcount_and_delay_shutdown.sh`,
`echo "${bumpShutdown}; touch /run/shutdown-refcount/start_run_\\$(date +%s)_\\$RANDOM" > /run/delay_shutdown.sh`,
`echo "[ \\$(find /run/shutdown-refcount/ -name 'start_run_*' | wc -l) -eq \\$(find /run/shutdown-refcount/ -name 'end_run_*' | wc -l) ] && shutdown -P 5" > /run/if_refcount0_shutdown.sh`,
`echo "${bumpShutdown}; touch /run/shutdown-refcount/end_run_\\$(date +%s)_\\$RANDOM ; /run/if_refcount0_shutdown.sh " > /run/refcount_and_delay_shutdown.sh`,
"chmod +x /run/delay_shutdown.sh",
"chmod +x /run/refcount_and_delay_shutdown.sh",
"chmod +x /run/if_refcount0_shutdown.sh",
Expand Down

0 comments on commit e6e779b

Please sign in to comment.