add SQLite semaphore mockup

This commit is contained in:
Nick Sweeting
2024-09-22 16:28:30 -07:00
parent 28aea6465e
commit d89b6ce419
4 changed files with 120 additions and 17 deletions

View File

@@ -36,6 +36,7 @@ class BaseQueue(BaseHook):
return AttrDict(all_tasks)
def get_huey_config(self, settings) -> dict:
"""Get the config dict to insert into django.conf.settings.DJANGO_HUEY['queues']."""
return {
"huey_class": "huey.SqliteHuey",
"filename": settings.QUEUE_DATABASE_NAME,
@@ -58,6 +59,7 @@ class BaseQueue(BaseHook):
}
def get_supervisor_config(self, settings) -> dict:
"""Ge the config dict used to tell sueprvisord to start a huey consumer for this queue."""
return {
"name": f"worker_{self.name}",
"command": f"archivebox manage djangohuey --queue {self.name}",

View File

@@ -63,7 +63,7 @@ def convert(ini_str: str) -> str:
### Basic Assertions
test_input = """
test_input = r"""
[SERVER_CONFIG]
IS_TTY=False
USE_COLOR=False
@@ -225,7 +225,7 @@ NODE_VERSION=v21.7.3
"""
expected_output = '''[SERVER_CONFIG]
expected_output = r'''[SERVER_CONFIG]
IS_TTY = false
USE_COLOR = false
SHOW_PROGRESS = false