-
Notifications
You must be signed in to change notification settings - Fork 582
fix(celery): Get driver_type from broker's URL
#5461
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
base: master
Are you sure you want to change the base?
Changes from all commits
bfd6524
da73f25
cfc0a1d
a0ffa84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,34 @@ def _get_humanized_interval(seconds: float) -> "Tuple[int, MonitorConfigSchedule | |
| return (int(seconds), "second") | ||
|
|
||
|
|
||
| def _get_driver_type_from_url_scheme(scheme) -> str: | ||
| # Source: https://github.com/celery/kombu/blob/5cbdaf97131d8a3de005f1355b567b0d60224829/kombu/transport/__init__.py#L21-L48 | ||
| url_scheme_to_driver_type_mapping = { | ||
| "amqp": "amqp", | ||
| "amqps": "amqp", | ||
| "confluentkafka": "kafka", | ||
| "kafka": "kafka", | ||
| "memory": "memory", | ||
| "redis": "redis", | ||
| "rediss": "redis", | ||
| "SQS": "sqs", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uppercase
|
||
| "sqs": "sqs", | ||
| "mongodb": "mongodb", | ||
| "zookeeper": "zookeeper", | ||
| "filesystem": "filesystem", | ||
| "qpid": "qpid", | ||
| "sentinel": "redis", | ||
| "consul": "consul", | ||
| "etcd": "etcd", | ||
| "pyro": "pyro", | ||
| "gcpubsub": "gcpubsub", | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mapping missing several valid Kombu transport URL schemesMedium Severity The |
||
|
|
||
| # "N/A" is set as the fallback value in Kombu when a `driver_type` | ||
| # is not set on the Kombu Transport class itself. | ||
| return url_scheme_to_driver_type_mapping.get(scheme, "N/A") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. URL schemes with
|
||
|
|
||
|
|
||
| class NoOpMgr: | ||
| def __enter__(self) -> None: | ||
| return None | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.