Django Postgres Lock
Project description
A Django management command which will run a command inside a Postgres lock, ensuring that only a single instance of the inner command will run.
Installation
Using pip:
$ pip install django-postgres-lock
Edit your Django project’s settings module, and add the application to INSTALLED_APPS:
INSTALLED_APPS = [
# ...
"postgres_lock",
# ...
]
Usage
To run clearsessions with the default lock:
$ ./manage.py command_lock -- ./manage.py clearsessions
To use a unique lock for this task:
$ ./manage.py command_lock --name clearsessions -- ./manage.py clearsessions
To exit immediately if a lock can’t be acquired:
$ ./manage.py command_lock --try --name clearsessions -- ./manage.py clearsessions
To ignore a lock failure and return a successful exit code:
$ ./manage.py command_lock --try --ignore-fail --name clearsessions -- ./manage.py clearsessions
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-postgres-lock-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0be614d18730740d39ae44705b30f5e71e3811e50692af7e01f5c05d1a8c7a0b |
|
MD5 | d39af37608b51fe274c5403b6e979f8a |
|
BLAKE2b-256 | fd39054140327b70bc2173be1ca7e6f0d8453748b8f439df4bd3c88990333841 |
Close
Hashes for django_postgres_lock-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e22c9934bd4f24061398c19a734209658d2868226daf8e6f2625c23e1e27ffd0 |
|
MD5 | 4922798ff1b1938546a8e87af25ef307 |
|
BLAKE2b-256 | da12bcdc463865e4aa36d7ec4ca3465ec2728dc5c7aa9fa3230237143f8f557b |