mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-17 16:09:14 +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.jobs.test import test_job
|
||||
|
||||
from selfprivacy_api.backup.tasks import *
|
||||
from selfprivacy_api.services.tasks import move_service
|
||||
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."""
|
||||
import os
|
||||
from os import environ
|
||||
from huey import RedisHuey
|
||||
|
||||
|
@ -7,6 +6,7 @@ from selfprivacy_api.utils.redis_pool import RedisPool
|
|||
|
||||
HUEY_DATABASE_NUMBER = 10
|
||||
|
||||
|
||||
def immediate() -> bool:
|
||||
if environ.get("HUEY_QUEUES_FOR_TESTS"):
|
||||
return False
|
||||
|
@ -14,6 +14,7 @@ def immediate() -> bool:
|
|||
return True
|
||||
return False
|
||||
|
||||
|
||||
# Singleton instance containing the huey database.
|
||||
huey = RedisHuey(
|
||||
"selfprivacy-api",
|
||||
|
|
Loading…
Reference in a new issue