Skip to content

Commit ea478f7

Browse files
committed
do not start worker for local queue
1 parent cd07892 commit ea478f7

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

src/actinia_cloudevent_plugin/api/cloudevents.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
SimpleStatusCodeResponseModel,
3838
)
3939
from actinia_cloudevent_plugin.resources.config import EVENTRECEIVER
40+
from actinia_cloudevent_plugin.resources.logging import log
4041

4142

4243
class Cloudevent(Resource):
@@ -74,18 +75,26 @@ def post(self) -> SimpleStatusCodeResponseModel:
7475
queue_name = actinia_resp["queue"]
7576

7677
try:
77-
# TODO: Send event to JobSink
78-
# TODO: Configure JobSink URL
79-
# url = TODO
80-
# new_event = send_binary_cloud_event(
81-
# event_received,
82-
# queue_name,
83-
# url,
84-
# )
78+
if queue_name == "local":
79+
# Nothing to do here, the configured actinia-core
80+
# instance is using a local queue, meaning that the
81+
# job is processed directly.
82+
log.info('No need to start actinia-worker',
83+
'actinia-core processes locally')
84+
else:
85+
pass
86+
# TODO: Send event to JobSink
87+
# TODO: Configure JobSink URL
88+
# url = TODO
89+
# new_event = send_binary_cloud_event(
90+
# event_received,
91+
# queue_name,
92+
# url,
93+
# )
8594

8695
# Send event to configured broker
87-
# TODO: binary or structured cloud event?
8896
url = EVENTRECEIVER.url
97+
# TODO: binary or structured cloud event?
8998
new_event = send_binary_cloud_event(
9099
event_received,
91100
actinia_resp["queue"],

0 commit comments

Comments
 (0)