Skip to content

Instantly share code, notes, and snippets.

@chrismeyersfsu
Created March 15, 2024 18:48
Show Gist options
  • Save chrismeyersfsu/af5a12bfab25697a4a31c4c513938e10 to your computer and use it in GitHub Desktop.
Save chrismeyersfsu/af5a12bfab25697a4a31c4c513938e10 to your computer and use it in GitHub Desktop.
lock
from awx.main.utils.pglock import advisory_lock
def locktest():
with advisory_lock('inspect_execution_and_hop_nodes_lock', wait=False):
print("We got the lock!")
print("Done")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment