mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-11 23:53:52 -05:00
when clients are defined in app/__init__.py, it increases the chance of cyclical imports. By moving module level client singletons out to a separate extensions file, we stop cyclical imports, but keep the same code flow - the clients are still initialised in `create_app` in `__init__.py`. The redis client in particular is no longer separate - previously redis was set up on the `NotifyAdminAPIClient` base class, but now there's one singleton in `app.extensions`. This was done so that we can access redis from outside of the existing clients.
12 lines
445 B
Python
12 lines
445 B
Python
from notifications_utils.clients.antivirus.antivirus_client import (
|
|
AntivirusClient,
|
|
)
|
|
from notifications_utils.clients.redis.redis_client import RedisClient
|
|
from notifications_utils.clients.statsd.statsd_client import StatsdClient
|
|
from notifications_utils.clients.zendesk.zendesk_client import ZendeskClient
|
|
|
|
antivirus_client = AntivirusClient()
|
|
statsd_client = StatsdClient()
|
|
zendesk_client = ZendeskClient()
|
|
redis_client = RedisClient()
|