mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-06-03 16:18:59 -04:00
only load django huey config when not getting help or version to avoid creating queue.sqlite3
This commit is contained in:
parent
02a1fc3049
commit
d48a99ab64
1 changed files with 31 additions and 30 deletions
|
@ -263,7 +263,8 @@ MIGRATION_MODULES = {'signal_webhooks': None}
|
||||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||||
|
|
||||||
|
|
||||||
HUEY = {
|
if not IS_GETTING_VERSION_OR_HELP: # dont create queue.sqlite3 file if we're just running to get --version or --help
|
||||||
|
HUEY = {
|
||||||
"huey_class": "huey.SqliteHuey",
|
"huey_class": "huey.SqliteHuey",
|
||||||
"filename": CONSTANTS.QUEUE_DATABASE_FILENAME,
|
"filename": CONSTANTS.QUEUE_DATABASE_FILENAME,
|
||||||
"name": "system_tasks",
|
"name": "system_tasks",
|
||||||
|
@ -282,18 +283,18 @@ HUEY = {
|
||||||
"check_worker_health": True, # Enable worker health checks.
|
"check_worker_health": True, # Enable worker health checks.
|
||||||
"health_check_interval": 1, # Check worker health every second.
|
"health_check_interval": 1, # Check worker health every second.
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
# https://huey.readthedocs.io/en/latest/contrib.html#setting-things-up
|
# https://huey.readthedocs.io/en/latest/contrib.html#setting-things-up
|
||||||
# https://github.com/gaiacoop/django-huey
|
# https://github.com/gaiacoop/django-huey
|
||||||
DJANGO_HUEY = {
|
DJANGO_HUEY = {
|
||||||
"default": "system_tasks",
|
"default": "system_tasks",
|
||||||
"queues": {
|
"queues": {
|
||||||
HUEY["name"]: HUEY.copy(),
|
HUEY["name"]: HUEY.copy(),
|
||||||
# more registered here at plugin import-time by BaseQueue.register()
|
# more registered here at plugin import-time by BaseQueue.register()
|
||||||
**abx.django.use.get_DJANGO_HUEY_QUEUES(QUEUE_DATABASE_NAME=CONSTANTS.QUEUE_DATABASE_FILENAME),
|
**abx.django.use.get_DJANGO_HUEY_QUEUES(QUEUE_DATABASE_NAME=CONSTANTS.QUEUE_DATABASE_FILENAME),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
class HueyDBRouter:
|
class HueyDBRouter:
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue