@@ -97,7 +97,7 @@ async def start_operation(
9797 schedule_data_proxy = ScheduleDataStoreProxy (
9898 store = self ._store , schedule_id = schedule_id
9999 )
100- await schedule_data_proxy .set_multiple (
100+ await schedule_data_proxy .create_or_update_multiple (
101101 {
102102 "operation_name" : operation_name ,
103103 "group_index" : 0 ,
@@ -110,7 +110,7 @@ async def start_operation(
110110 schedule_id = schedule_id ,
111111 operation_name = operation_name ,
112112 )
113- await operation_content_proxy .set_provided_context (initial_operation_context )
113+ await operation_content_proxy .create_or_update (initial_operation_context )
114114
115115 await enqueue_schedule_event (self .app , schedule_id )
116116 return schedule_id
@@ -127,7 +127,7 @@ async def cancel_operation(self, schedule_id: ScheduleId) -> None:
127127 store = self ._store , schedule_id = schedule_id
128128 )
129129
130- is_creating = await schedule_data_proxy .get ("is_creating" )
130+ is_creating = await schedule_data_proxy .read ("is_creating" )
131131
132132 if is_creating is False :
133133 _logger .warning (
@@ -136,8 +136,8 @@ async def cancel_operation(self, schedule_id: ScheduleId) -> None:
136136 )
137137 return
138138
139- operation_name = await schedule_data_proxy .get ("operation_name" )
140- group_index = await schedule_data_proxy .get ("group_index" )
139+ operation_name = await schedule_data_proxy .read ("operation_name" )
140+ group_index = await schedule_data_proxy .read ("group_index" )
141141
142142 operation = OperationRegistry .get_operation (operation_name )
143143 group = operation [group_index ]
@@ -172,9 +172,9 @@ async def _cancel_step(step_name: StepName, step_proxy: StepStoreProxy) -> None:
172172 f"Cancelling step { step_name = } of { operation_name = } for { schedule_id = } " ,
173173 ):
174174 with suppress (NoDataFoundError ):
175- deferred_task_uid = await step_proxy .get ("deferred_task_uid" )
175+ deferred_task_uid = await step_proxy .read ("deferred_task_uid" )
176176 await DeferredRunner .cancel (deferred_task_uid )
177- await step_proxy .set ("status" , StepStatus .CANCELLED )
177+ await step_proxy .create_or_update ("status" , StepStatus .CANCELLED )
178178
179179 await limited_gather (
180180 * (
@@ -198,9 +198,9 @@ async def restart_operation_step_stuck_in_error(
198198 schedule_data_proxy = ScheduleDataStoreProxy (
199199 store = self ._store , schedule_id = schedule_id
200200 )
201- is_creating = await schedule_data_proxy .get ("is_creating" )
202- operation_name = await schedule_data_proxy .get ("operation_name" )
203- group_index = await schedule_data_proxy .get ("group_index" )
201+ is_creating = await schedule_data_proxy .read ("is_creating" )
202+ operation_name = await schedule_data_proxy .read ("operation_name" )
203+ group_index = await schedule_data_proxy .read ("group_index" )
204204
205205 operation = OperationRegistry .get_operation (operation_name )
206206 step_group = operation [group_index ]
@@ -225,7 +225,7 @@ async def restart_operation_step_stuck_in_error(
225225 )
226226
227227 try :
228- await step_proxy .get ("error_traceback" )
228+ await step_proxy .read ("error_traceback" )
229229 except NoDataFoundError as exc :
230230 raise StepNotInErrorStateError (step_name = step_name ) from exc
231231
@@ -237,7 +237,7 @@ async def restart_operation_step_stuck_in_error(
237237 if in_manual_intervention :
238238 requires_manual_intervention : bool = False
239239 with suppress (NoDataFoundError ):
240- requires_manual_intervention = await step_proxy .get (
240+ requires_manual_intervention = await step_proxy .read (
241241 "requires_manual_intervention"
242242 )
243243
@@ -330,9 +330,9 @@ async def _on_schedule_event(self, schedule_id: ScheduleId) -> None:
330330 store = self ._store , schedule_id = schedule_id
331331 )
332332
333- operation_name = await schedule_data_proxy .get ("operation_name" )
334- is_creating = await schedule_data_proxy .get ("is_creating" )
335- group_index = await schedule_data_proxy .get ("group_index" )
333+ operation_name = await schedule_data_proxy .read ("operation_name" )
334+ is_creating = await schedule_data_proxy .read ("is_creating" )
335+ group_index = await schedule_data_proxy .read ("group_index" )
336336
337337 operation = OperationRegistry .get_operation (operation_name )
338338 step_group = operation [group_index ]
@@ -434,7 +434,7 @@ async def _advance_as_repeating(
434434 steps_stauses = await get_steps_statuses (step_proxies )
435435 if any (status == StepStatus .CANCELLED for status in steps_stauses .values ()):
436436 # NOTE:
437- await schedule_data_proxy .set ("is_creating" , value = False )
437+ await schedule_data_proxy .create_or_update ("is_creating" , value = False )
438438 await enqueue_schedule_event (self .app , schedule_id )
439439 return
440440
@@ -477,7 +477,9 @@ async def _advance_as_creating(
477477 next_group_index = group_index + 1
478478 # does a next group exist?
479479 _ = operation [next_group_index ]
480- await schedule_data_proxy .set ("group_index" , value = next_group_index )
480+ await schedule_data_proxy .create_or_update (
481+ "group_index" , value = next_group_index
482+ )
481483 await enqueue_schedule_event (self .app , schedule_id )
482484 except IndexError :
483485
@@ -504,7 +506,9 @@ async def _advance_as_creating(
504506 step_name = step .get_step_name (),
505507 is_creating = True ,
506508 )
507- await step_proxy .set ("requires_manual_intervention" , value = True )
509+ await step_proxy .create_or_update (
510+ "requires_manual_intervention" , value = True
511+ )
508512 manual_intervention_step_names .add (step .get_step_name ())
509513
510514 if manual_intervention_step_names :
@@ -528,7 +532,7 @@ async def _advance_as_creating(
528532 logging .DEBUG ,
529533 f"{ operation_name = } was not successfull: { steps_statuses = } , moving to revert" ,
530534 ):
531- await schedule_data_proxy .set ("is_creating" , value = False )
535+ await schedule_data_proxy .create_or_update ("is_creating" , value = False )
532536 await enqueue_schedule_event (self .app , schedule_id )
533537 return
534538
@@ -564,7 +568,9 @@ async def _advance_as_reverting(
564568 return
565569
566570 # 1b) -> move to previous group
567- await schedule_data_proxy .set ("group_index" , value = previous_group_index )
571+ await schedule_data_proxy .create_or_update (
572+ "group_index" , value = previous_group_index
573+ )
568574 await enqueue_schedule_event (self .app , schedule_id )
569575 return
570576
0 commit comments