mirror of
https://github.com/status-im/spiff-arena.git
synced 2025-01-14 04:05:31 +00:00
Don't schedule a cycle with 0 second duration (#417)
* Don't schedule a cycle with 0 second duration * PR feedback * Getting bin_pyl to pass
This commit is contained in:
parent
1bc8ffc47d
commit
7ccb0aec62
@ -129,7 +129,15 @@ class ProcessInstanceService:
|
||||
for cycle in cycles:
|
||||
db.session.delete(cycle)
|
||||
|
||||
db.session.commit()
|
||||
|
||||
if cycle_count != 0:
|
||||
if duration_in_seconds == 0:
|
||||
raise ApiError(
|
||||
error_code="process_model_cycle_has_0_second_duration",
|
||||
message="Can not schedule a process model cycle with a duration in seconds of 0.",
|
||||
)
|
||||
|
||||
cycle = ProcessModelCycleModel(
|
||||
process_model_identifier=process_model_identifier,
|
||||
cycle_count=cycle_count,
|
||||
@ -137,8 +145,7 @@ class ProcessInstanceService:
|
||||
current_cycle=0,
|
||||
)
|
||||
db.session.add(cycle)
|
||||
|
||||
db.session.commit()
|
||||
db.session.commit()
|
||||
|
||||
@classmethod
|
||||
def schedule_next_process_model_cycle(cls, process_instance_model: ProcessInstanceModel) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user