mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-02-02 22:26:37 +00:00
test(huey): only import test task if it is a test
This commit is contained in:
parent
8e48a5ad5f
commit
baf7843349
|
@ -1,6 +1,12 @@
|
||||||
|
from os import environ
|
||||||
|
|
||||||
from selfprivacy_api.utils.huey import huey
|
from selfprivacy_api.utils.huey import huey
|
||||||
from selfprivacy_api.jobs.test import test_job
|
|
||||||
from selfprivacy_api.backup.tasks import *
|
from selfprivacy_api.backup.tasks import *
|
||||||
from selfprivacy_api.services.tasks import move_service
|
from selfprivacy_api.services.tasks import move_service
|
||||||
from selfprivacy_api.jobs.upgrade_system import rebuild_system_task
|
from selfprivacy_api.jobs.upgrade_system import rebuild_system_task
|
||||||
from tests.test_huey import sum
|
|
||||||
|
from selfprivacy_api.jobs.test import test_job
|
||||||
|
|
||||||
|
if environ.get("TEST_MODE"):
|
||||||
|
from tests.test_huey import sum
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
"""MiniHuey singleton."""
|
"""MiniHuey singleton."""
|
||||||
import os
|
|
||||||
from os import environ
|
from os import environ
|
||||||
from huey import RedisHuey
|
from huey import RedisHuey
|
||||||
|
|
||||||
|
@ -7,6 +6,7 @@ from selfprivacy_api.utils.redis_pool import RedisPool
|
||||||
|
|
||||||
HUEY_DATABASE_NUMBER = 10
|
HUEY_DATABASE_NUMBER = 10
|
||||||
|
|
||||||
|
|
||||||
def immediate() -> bool:
|
def immediate() -> bool:
|
||||||
if environ.get("HUEY_QUEUES_FOR_TESTS"):
|
if environ.get("HUEY_QUEUES_FOR_TESTS"):
|
||||||
return False
|
return False
|
||||||
|
@ -14,6 +14,7 @@ def immediate() -> bool:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
# Singleton instance containing the huey database.
|
# Singleton instance containing the huey database.
|
||||||
huey = RedisHuey(
|
huey = RedisHuey(
|
||||||
"selfprivacy-api",
|
"selfprivacy-api",
|
||||||
|
|
Loading…
Reference in a new issue