BPL Account Holders enrolment API
- create a
local.env
file in the root directory - add your configurations based on the environmental variables required in
polaris.core.config.Settings
or use the file in local/local.env.example as template
poetry install
poetry run python asgi.py
orpoetry run uvicorn asgi:app --port=8000
PROMETHEUS_MULTIPROC_DIR=/tmp gunicorn --workers=2 --worker-class=uvicorn.workers.UvicornWorker --bind=0.0.0.0:8000 --bind=0.0.0.0:9100 asgi:app
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES poetry run python -m polaris.core.cli task-worker
- this worker deals with async tasks, for example activating pending account holders and executing the HTTP callback to the enrolling party
Running the command with the above environment variable is a work around for this issue. It's a mac only issue to do with os.fork()'ing which rq.Worker utilises.
poetry run python -m polaris.core.cli cron-scheduler
- schedules regular tasks, for example processing pending rewards that need converting
- create a
Settings.POSTGRES_DB + _test
database in postgres poetry run pytest tests