Skip to content

Commit

Permalink
feat: config huey to use redis (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
vncsna authored Oct 4, 2023
1 parent 970f7c9 commit 653aae6
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
11 changes: 9 additions & 2 deletions basedosdados_api/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,21 @@

HUEY = {
"name": "api.queue",
"huey_class": "huey.SqliteHuey",
"huey_class": "huey.RedisHuey",
"results": True,
"immediate": False,
"filename": path.join(BASE_DIR, "queue.sqlite3"),
"connection": {
"host": getenv("REDIS_URL", "localhost"),
"port": getenv("REDIS_PORT", 6379),
"db": getenv("REDIS_DB", 1),
"read_timeout": 1,
"connection_pool": None,
},
"consumer": {
"workers": 2,
"worker_type": "thread",
"check_worker_health": True,
"periodic": True,
},
}
HUEY = None
33 changes: 32 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ google-cloud-bigquery = "^3.11.3"
faker = "^19.6.1"
loguru = "^0.7.2"
huey = "^2.5.0"
redis = "^5.0.1"

[tool.poetry.group.dev.dependencies]
black = "^22.3.0"
Expand Down

0 comments on commit 653aae6

Please sign in to comment.