Skip to content

Instantly share code, notes, and snippets.

@mayhem
Last active November 11, 2025 14:39
Show Gist options
  • Select an option

  • Save mayhem/6928f987e7e871eaa80293e3ff5943b3 to your computer and use it in GitHub Desktop.

Select an option

Save mayhem/6928f987e7e871eaa80293e3ff5943b3 to your computer and use it in GitHub Desktop.
Rebuild:
1. Check for lock (timestamp, pid, epoch time)
2. If present and pid still exists, sleep for 60 seconds.
3. Otherwise set lock and proceed
Incremental:
1. Check for lock
2. If present and pid still exists, exit.
3. If lock not present or pid no longer exists, set lock, proceed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment