-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathqueue_configuration.py
More file actions
45 lines (37 loc) · 1.3 KB
/
queue_configuration.py
File metadata and controls
45 lines (37 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from typing import Any
from ...utils import get_backend, get_queue_counts
from ...app_settings import app_settings
from ...command_utils import CommandWithExtraSettings
from ...cron_scheduler import get_cron_config
class Command(CommandWithExtraSettings):
def handle(self, **options: Any) -> None:
super().handle_extra_settings(**options)
print("django-lightweight-queue")
print("========================")
print("")
print("{0:<55} {1:<5} {2}".format("Queue name", "Concurrency", "Backend"))
print("-" * 27)
for k, v in sorted(get_queue_counts().items()):
print(" {0:<54} {1:<5} {2}".format(
k,
v,
get_backend(k).__class__.__name__,
))
print("")
print("Middleware:")
for x in app_settings.MIDDLEWARE:
print(" * {}".format(x))
print("")
print("Cron configuration")
for config in get_cron_config():
print("")
for key in (
'command',
'command_args',
'hours',
'minutes',
'queue',
'timeout',
'sigkill_on_stop',
):
print("{:20s}: {}".format(key, config.get(key, '-')))