https://github.com/mlipscombe/instance-config
https://github.com/mlipscombe/instance-config
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mlipscombe/instance-config
- Owner: mlipscombe
- License: bsd-3-clause
- Created: 2017-11-06T03:03:22.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-06T04:44:37.000Z (over 8 years ago)
- Last Synced: 2025-12-17T03:20:47.521Z (7 months ago)
- Language: Python
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- License: LICENSE
Awesome Lists containing this project
README
===============================
instance-config
===============================
.. image:: https://img.shields.io/pypi/v/instance-config.svg
:target: https://pypi.python.org/pypi/instance-config
A simple library using consul locks to do one-time configuration tasks on AWS instances.
How to use it
--------------
.. code-block:: python
from instance_config import Instance
instance = Instance()
@instance.every()
def do_each_time():
# This will run every time the script is invoked.
return
@instance.once(key='locks/my_app/create_user', version=1, timeout=60)
def create_user():
# This will only be run once, in declared order, for each version.
return do_create_user()