Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added domain and polling_interval in config and env vars for worker tasks #225

Merged
merged 3 commits into from
Nov 30, 2023

Conversation

coderabhigupta
Copy link
Contributor

@coderabhigupta coderabhigupta commented Nov 21, 2023

Worker Configuration

Using Config File

Added support to read an worker.ini file in the root directory of the worker code that allows for setting default values for task domain and polling intervals for workers. Config file will always override constructor params. These properties are expected to be in the form of:

[task_definition_name]
domain = <domain>
polling_interval = <polling-interval-in-ms>

[DEFAULT]
domain = <domain>
polling_interval = <polling-interval-in-ms>

Examples:

[DEFAULT]
domain = nice
polling_interval = 2000

[python_annotated_task_1]
domain = cool
polling_interval = 500

[python_annotated_task_2]
domain = hot
polling_interval = 300

Using Environment Variables

Workers can also be configured at run time by using environment variables which override configuration files as well. Environment variables will always override Config file. Upper case ENV vars are also supported but task definition names will be case sensitive.

Examples:

CONDUCTOR_WORKER_DOMAIN=nice
conductor_worker_polling_interval=2000
conductor_worker_python_annotated_task_1_domain=cool
CONDUCTOR_WORKER_python_annotated_task_1_POLLING_INTERVAL=500
CONDUCTOR_WORKER_python_annotated_task_2_DOMAIN=hot
conductor_worker_python_annotated_task_2_polling_interval=300

@coderabhigupta coderabhigupta requested review from v1r3n and c4lm November 21, 2023 04:47
@coderabhigupta coderabhigupta changed the title Added domain and pollingInterval as system properties for a task type Added domain and polling_interval in config and env vars for worker tasks Nov 29, 2023
@coderabhigupta coderabhigupta merged commit 2cc39d3 into main Nov 30, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants