Commit 8a5047da authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

add huey

parent 026dda69
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -7,3 +7,6 @@ partial_uploads
iiif
*.log
media_source_files
huey.db
huey.db-shm
huey.db-wal
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ INSTALLED_APPS = [
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
    "huey.contrib.djhuey",
]

if DEBUG:
@@ -205,3 +206,24 @@ LOGGING = {
        "rpc.sql": {"level": "DEBUG", "handlers": ["file"]},
    },
}


HUEY = {
    "huey_class": "huey.SqliteHuey",  # Huey implementation to use.
    "filename": "{}/huey.db".format(BASE_DIR),
    "results": True,  # Store return values of tasks.
    "store_none": False,  # If a task returns None, do not save to results.
    "immediate": False,  # If DEBUG=True, run synchronously.
    "utc": True,  # Use UTC for all times internally.
    "consumer": {
        "workers": 1,
        "worker_type": "thread",
        "initial_delay": 0.1,  # Smallest polling interval, same as -d.
        "backoff": 1.15,  # Exponential backoff using this rate, -b.
        "max_delay": 10.0,  # Max possible polling interval, -m.
        "scheduler_interval": 1,  # Check schedule every second, -s.
        "periodic": True,  # Enable crontab feature.
        "check_worker_health": True,  # Enable worker health checks.
        "health_check_interval": 1,  # Check worker health every second.
    },
}
+2 −1
Original line number Diff line number Diff line
@@ -9,3 +9,4 @@ python-dotenv
unidecode
django-ranged-fileresponse
pyvips
huey
 No newline at end of file