-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding run_once functionality #43
Conversation
Using unix sockets when specified
removes shlex and uses the argparse built-in solution
adapter = adapters.UnixSocketRequest | ||
port = None | ||
api_host = os.environ.get('CONSUL_HTTP_ADDR').replace('unix://', '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's going on here? it seems you're neutering the unix socket interface intentionally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gmr I'm trying to simplify the command line arguments when connecting with a unix socket. If we're using sockets, the idea is to read the socket location from Consul's stored environment variable, instead of requiring it over the command line.
I could use the environment variable as the default and override if it's passed in as an arg
This looks good other than removing |
@gmr I re-instituted |
use correct session
use a different consul key for last_run
Looks reasonable, any chance you can rebase off master? |
Adds the ability to lock a command to the calling process - with the optional limit that the command can only be run once an interval
Usage
To run the echo command once, across a cluster of servers, and to ensure that it's only run once every 60 seconds
This relies on using consulate's existing
acquire_lock
function as well as setting a lock with a unique name, such that subsequent executions can reference the last time the command was run