|
1 |
| -# -*- coding: utf-8 -*- |
2 |
| -import logging |
3 | 1 | import os
|
4 |
| -import sys |
5 |
| -import typing |
6 |
| - |
7 |
| -import click |
8 |
| -from celery.signals import worker_process_shutdown |
9 |
| -from prometheus_client import REGISTRY, CollectorRegistry, multiprocess |
10 |
| -from shared.celery_config import BaseCeleryConfig |
11 |
| -from shared.config import get_config |
12 |
| -from shared.license import startup_license_logging |
13 |
| -from shared.metrics import start_prometheus |
14 |
| -from shared.storage.exceptions import BucketAlreadyExistsError |
15 |
| - |
16 |
| -import app |
17 |
| -from helpers.environment import get_external_dependencies_folder |
18 |
| -from helpers.version import get_current_version |
19 |
| -from services.storage import get_storage_client |
| 2 | + |
| 3 | +import django |
| 4 | + |
| 5 | +# we're moving this before we create the Celery object |
| 6 | +# so that celery can detect Django is being used |
| 7 | +# using the Django fixup will help fix some database issues |
| 8 | +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_scaffold.settings") |
| 9 | +django.setup() |
| 10 | + |
| 11 | +# -*- coding: utf-8 -*- |
| 12 | +import logging # noqa: E402 |
| 13 | +import os # noqa: E402 |
| 14 | +import sys # noqa: E402 |
| 15 | +import typing # noqa: E402 |
| 16 | + |
| 17 | +import click # noqa: E402 |
| 18 | +import shared.storage # noqa: E402 |
| 19 | +from celery.signals import worker_process_shutdown # noqa: E402 |
| 20 | +from prometheus_client import REGISTRY, CollectorRegistry, multiprocess # noqa: E402 |
| 21 | +from shared.celery_config import BaseCeleryConfig # noqa: E402 |
| 22 | +from shared.config import get_config # noqa: E402 |
| 23 | +from shared.license import startup_license_logging # noqa: E402 |
| 24 | +from shared.metrics import start_prometheus # noqa: E402 |
| 25 | +from shared.storage.exceptions import BucketAlreadyExistsError # noqa: E402 |
| 26 | + |
| 27 | +import app # noqa: E402 |
| 28 | +from helpers.environment import get_external_dependencies_folder # noqa: E402 |
| 29 | +from helpers.version import get_current_version # noqa: E402 |
20 | 30 |
|
21 | 31 | log = logging.getLogger(__name__)
|
22 | 32 |
|
@@ -69,7 +79,9 @@ def setup_worker():
|
69 | 79 |
|
70 | 80 | start_prometheus(9996, registry=registry) # 9996 is an arbitrary port number
|
71 | 81 |
|
72 |
| - storage_client = get_storage_client() |
| 82 | + # this storage client is only used to create the bucket so it doesn't need to be |
| 83 | + # aware of the repoid |
| 84 | + storage_client = shared.storage.get_appropriate_storage_service() |
73 | 85 | minio_config = get_config("services", "minio")
|
74 | 86 | bucket_name = get_config("services", "minio", "bucket", default="archive")
|
75 | 87 | auto_create_bucket = get_config(
|
|
0 commit comments