No description
- Python 99.7%
- Shell 0.1%
|
Some checks failed
test / test (push) Failing after 1s
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> |
||
|---|---|---|
| .github/workflows | ||
| local | ||
| polaris | ||
| tests | ||
| .coveragerc | ||
| .dockerignore | ||
| .gitignore | ||
| alembic.ini | ||
| asgi.py | ||
| Dockerfile | ||
| poetry.lock | ||
| pyproject.toml | ||
| README.md | ||
| renovate.json | ||
| style.sh | ||
Polaris
BPL Account Holders enrolment API
configurations
- create a
local.envfile in the root directory - add your configurations based on the environmental variables required in
polaris.core.config.Settingsor use the file in local/local.env.example as template
running
poetry install
api run
poetry run python asgi.pyorpoetry run uvicorn asgi:app --port=8000
api run + prometheus metrics
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
task worker (rq)
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.
cron scheduler (apscheduler)
poetry run python -m polaris.core.cli cron-scheduler- schedules regular tasks, for example processing pending rewards that need converting
unittest
- create a
Settings.POSTGRES_DB + _testdatabase in postgres poetry run pytest tests