Added examples
This commit is contained in:
parent
0ebca05144
commit
b5a436be4a
25
README.md
25
README.md
|
|
@ -1,3 +1,28 @@
|
||||||
# asyncron
|
# asyncron
|
||||||
|
|
||||||
A minimal async task scheduler django app!
|
A minimal async task scheduler django app!
|
||||||
|
|
||||||
|
|
||||||
|
Add this to your gunicorn.py config:
|
||||||
|
`from asyncron.gunicorn import post_fork`
|
||||||
|
|
||||||
|
Or run this
|
||||||
|
`python3 manage.py run_asyncron_worker`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Example Django Config:
|
||||||
|
```
|
||||||
|
ASYNCRON = {
|
||||||
|
"IMPORT_PER_APP": ["api", "tasks"], #Trys to load api.py and tasks.py files from apps inside your project
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Example Task in task.py:
|
||||||
|
```
|
||||||
|
import asyncron
|
||||||
|
@asyncron.task( interval = "10m", jitter = "+10m" )
|
||||||
|
async def keep_identity_provider_configs_fresh():
|
||||||
|
...
|
||||||
|
```
|
||||||
Loading…
Reference in New Issue
Block a user