allow queue worker process to hot reload if entr is available

This commit is contained in:
dandds 2018-10-16 09:54:49 -04:00
parent 6a2a7545ae
commit f13cc03d24
3 changed files with 16 additions and 1 deletions

View File

@ -1,3 +1,3 @@
assets: yarn watch
web: PORT=8000 python app.py
queue: flask rq worker
queue: ./script/dev_queue

View File

@ -39,6 +39,10 @@ locally:
running on the default port of 6379. You can ensure that Redis is running by
executing `redis-cli` with no options and ensuring a connection is succesfully made.
* [`entr`](http://www.entrproject.org/)
This dependency is optional. If present, the queue worker process will hot
reload in development.
### Cloning
This project contains git submodules. Here is an example clone command that will
automatically initialize and update those modules:

11
script/dev_queue Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
# script/dev_queue: Run the queue with entr if available
set -e
if [[ `command -v entr` ]]; then
find atst | entr -r flask rq worker
else
flask rq worker
fi