File tree 3 files changed +8
-8
lines changed
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def __getitem__(self, key: str | tuple) -> str:
21
21
return super ().__getitem__ (key )
22
22
23
23
24
- ACTION_TO_QUEUE = LayeredKeyDict ()
24
+ SELECTOR_TO_QUEUE = LayeredKeyDict ()
25
25
QUEUE_TO_PARSED_JOB_ID_CLS = {}
26
26
27
27
REQUEST_ID_SUBCLASSES = set ()
@@ -47,7 +47,7 @@ def init_subclasses(cur_cls: type[RequestId] = RequestId):
47
47
for queue_selector in parsed_job_id_cls .QUEUE_SELECTORS :
48
48
if not isinstance (queue_selector , (tuple , str )):
49
49
raise ImproperlyConfigured ("Wrong queue selector, must be either tuple or str" )
50
- ACTION_TO_QUEUE [queue_selector ] = queue_name
50
+ SELECTOR_TO_QUEUE [queue_selector ] = queue_name
51
51
52
52
QUEUE_TO_PARSED_JOB_ID_CLS [queue_name ] = parsed_job_id_cls
53
53
@@ -62,7 +62,7 @@ def init_subclasses(cur_cls: type[RequestId] = RequestId):
62
62
63
63
if subclass .QUEUE_SELECTORS :
64
64
for queue_selector in subclass .QUEUE_SELECTORS :
65
- if not ACTION_TO_QUEUE .get (queue_selector ):
65
+ if not SELECTOR_TO_QUEUE .get (queue_selector ):
66
66
raise ImproperlyConfigured (
67
67
f"Queue selector { queue_selector !r} for the class { subclass .__name__ !r} is missed in the queue configuration"
68
68
)
Original file line number Diff line number Diff line change 11
11
from rq .job import Job as RQJob
12
12
13
13
from cvat .apps .redis_handler .apps import (
14
- ACTION_TO_QUEUE ,
14
+ SELECTOR_TO_QUEUE ,
15
15
QUEUE_TO_PARSED_JOB_ID_CLS ,
16
16
REQUEST_ID_SUBCLASSES ,
17
17
)
@@ -161,7 +161,7 @@ def parse(
161
161
f"Unable to parse request ID: { escape (request_id )!r} "
162
162
)
163
163
164
- queue = ACTION_TO_QUEUE [
164
+ queue = SELECTOR_TO_QUEUE [
165
165
actual_cls .QUEUE_SELECTORS [0 ]
166
166
] # each selector match the same queue
167
167
fragments = match .groupdict ()
@@ -178,7 +178,7 @@ def parse(
178
178
179
179
if not queue :
180
180
# try to define queue dynamically based on action/target/subresource
181
- queue = ACTION_TO_QUEUE [
181
+ queue = SELECTOR_TO_QUEUE [
182
182
(dict_repr ["action" ], dict_repr ["target" ], dict_repr .get ("subresource" ))
183
183
]
184
184
Original file line number Diff line number Diff line change 25
25
from cvat .apps .engine .log import ServerLogManager
26
26
from cvat .apps .engine .rq import is_rq_job_owner
27
27
from cvat .apps .engine .types import ExtendedRequest
28
- from cvat .apps .redis_handler .apps import ACTION_TO_QUEUE
28
+ from cvat .apps .redis_handler .apps import SELECTOR_TO_QUEUE
29
29
from cvat .apps .redis_handler .rq import CustomRQJob , RequestId
30
30
from cvat .apps .redis_handler .serializers import RequestSerializer , RequestStatus
31
31
@@ -107,7 +107,7 @@ def get_queryset(self):
107
107
108
108
@property
109
109
def queues (self ) -> Iterable [DjangoRQ ]:
110
- return (django_rq .get_queue (queue_name ) for queue_name in set (ACTION_TO_QUEUE .values ()))
110
+ return (django_rq .get_queue (queue_name ) for queue_name in set (SELECTOR_TO_QUEUE .values ()))
111
111
112
112
def _get_rq_jobs_from_queue (self , queue : DjangoRQ , user_id : int ) -> list [RQJob ]:
113
113
job_ids = set (
You can’t perform that action at this time.
0 commit comments