-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for Limited FIDES__CELERY__* Env Vars (#4980)
Add limited support for setting some celery values via Fides Env vars: FIDES__CELERY__TASK_ALWAYS_EAGER, FIDES__CELERY__EVENT_QUEUE_PREFIX, and FIDES__CELERY__TASK_DEFAULT_QUEUE.
- Loading branch information
Showing
4 changed files
with
39 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from pydantic import Field | ||
|
||
from .fides_settings import FidesSettings | ||
|
||
ENV_PREFIX = "FIDES__CELERY__" | ||
|
||
|
||
class CelerySettings(FidesSettings): | ||
"""Configuration settings for Celery. Only a small subset can be configured through Fides env vars""" | ||
|
||
event_queue_prefix: str = Field( | ||
default="fides_worker", | ||
description="The prefix to use for event receiver queue names", | ||
) | ||
task_default_queue: str = Field( | ||
default="fides", | ||
description="The name of the default queue if a message has no route or no custom queue has been specified", | ||
) | ||
task_always_eager: bool = Field( | ||
default=True, | ||
description="If true, tasks are executed locally instead of being sent to the queue. " | ||
"If False, tasks are sent to the queue.", | ||
) | ||
|
||
class Config: | ||
env_prefix = ENV_PREFIX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters