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
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-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49d7d3523241e74135be095d56b5fbaa0423911b04dacb38a68ede3b68559134 |
|
MD5 | 53fda3bd8a75a648f47304f8d28644e6 |
|
BLAKE2b-256 | abb7db2839cfb161f1401b796be4ad042266f8a6ffaca38fcd99c59d4a645db6 |