2929)
3030
3131
32- def _get_step_store_proxy (context : DeferredContext ) -> StepStoreProxy :
32+ def get_step_store_proxy (context : DeferredContext ) -> StepStoreProxy :
3333 app : FastAPI = context ["app" ]
3434 schedule_id : ScheduleId = context ["schedule_id" ]
3535 operation_name : OperationName = context ["operation_name" ]
@@ -48,7 +48,7 @@ def _get_step_store_proxy(context: DeferredContext) -> StepStoreProxy:
4848 )
4949
5050
51- def _get_step_group_proxy (context : DeferredContext ) -> StepGroupProxy :
51+ def get_step_group_proxy (context : DeferredContext ) -> StepGroupProxy :
5252 app : FastAPI = context ["app" ]
5353 schedule_id : ScheduleId = context ["schedule_id" ]
5454 operation_name : OperationName = context ["operation_name" ]
@@ -90,7 +90,7 @@ async def _send_group_done_check_event(context: DeferredContext) -> None:
9090 expected_steps_count : NonNegativeInt = context ["expected_steps_count" ]
9191
9292 if (
93- await _get_step_group_proxy (context ).increment_and_get_done_steps_count ()
93+ await get_step_group_proxy (context ).increment_and_get_done_steps_count ()
9494 == expected_steps_count
9595 ):
9696 await enqueue_schedule_event (app , schedule_id )
@@ -161,7 +161,7 @@ async def get_timeout(cls, context: DeferredContext) -> timedelta:
161161
162162 @classmethod
163163 async def on_created (cls , task_uid : TaskUID , context : DeferredContext ) -> None :
164- await _get_step_store_proxy (context ).set_multiple (
164+ await get_step_store_proxy (context ).set_multiple (
165165 {"deferred_task_uid" : task_uid , "status" : StepStatus .CREATED }
166166 )
167167
@@ -170,7 +170,7 @@ async def run(cls, context: DeferredContext) -> None:
170170 app = context ["app" ]
171171 is_creating = context ["is_creating" ]
172172
173- await _get_step_store_proxy (context ).set ("status" , StepStatus .RUNNING )
173+ await get_step_store_proxy (context ).set ("status" , StepStatus .RUNNING )
174174
175175 step = _get_step (context )
176176
@@ -208,22 +208,22 @@ async def run(cls, context: DeferredContext) -> None:
208208 @classmethod
209209 async def on_result (cls , result : None , context : DeferredContext ) -> None :
210210 _ = result
211- await _get_step_store_proxy (context ).set ("status" , StepStatus .SUCCESS )
211+ await get_step_store_proxy (context ).set ("status" , StepStatus .SUCCESS )
212212
213213 await _send_group_done_check_event (context )
214214
215215 @classmethod
216216 async def on_finished_with_error (
217217 cls , error : TaskResultError , context : DeferredContext
218218 ) -> None :
219- await _get_step_store_proxy (context ).set_multiple (
219+ await get_step_store_proxy (context ).set_multiple (
220220 {"status" : StepStatus .FAILED , "error_traceback" : error .format_error ()}
221221 )
222222
223223 await _send_group_done_check_event (context )
224224
225225 @classmethod
226226 async def on_cancelled (cls , context : DeferredContext ) -> None :
227- await _get_step_store_proxy (context ).set ("status" , StepStatus .CANCELLED )
227+ await get_step_store_proxy (context ).set ("status" , StepStatus .CANCELLED )
228228
229229 await _send_group_done_check_event (context )
0 commit comments