Skip to content

Commit

Permalink
Fix accidental dataclass / IntEnum chimera
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Sep 6, 2024
1 parent aa4ab92 commit 5efb27d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions temporalio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3482,14 +3482,13 @@ async def _to_proto(
return action


@dataclass
class ScheduleOverlapPolicy(IntEnum):
"""Controls what happens when a workflow would be started by a schedule but
one is already running.
"""

SKIP = int(
temporalio.api.enums.v1.ScheduleOverlapPolicy.SCHEDULE_OVERLAP_POLICY_SKIP # pyright: ignore
temporalio.api.enums.v1.ScheduleOverlapPolicy.SCHEDULE_OVERLAP_POLICY_SKIP
)
"""Don't start anything.
Expand All @@ -3498,7 +3497,7 @@ class ScheduleOverlapPolicy(IntEnum):
"""

BUFFER_ONE = int(
temporalio.api.enums.v1.ScheduleOverlapPolicy.SCHEDULE_OVERLAP_POLICY_BUFFER_ONE # pyright: ignore
temporalio.api.enums.v1.ScheduleOverlapPolicy.SCHEDULE_OVERLAP_POLICY_BUFFER_ONE
)
"""Start the workflow again soon as the current one completes, but only
buffer one start in this way.
Expand All @@ -3509,25 +3508,25 @@ class ScheduleOverlapPolicy(IntEnum):
"""

BUFFER_ALL = int(
temporalio.api.enums.v1.ScheduleOverlapPolicy.SCHEDULE_OVERLAP_POLICY_BUFFER_ALL # pyright: ignore
temporalio.api.enums.v1.ScheduleOverlapPolicy.SCHEDULE_OVERLAP_POLICY_BUFFER_ALL
)
"""Buffer up any number of starts to all happen sequentially, immediately
after the running workflow completes."""

CANCEL_OTHER = int(
temporalio.api.enums.v1.ScheduleOverlapPolicy.SCHEDULE_OVERLAP_POLICY_CANCEL_OTHER # pyright: ignore
temporalio.api.enums.v1.ScheduleOverlapPolicy.SCHEDULE_OVERLAP_POLICY_CANCEL_OTHER
)
"""If there is another workflow running, cancel it, and start the new one
after the old one completes cancellation."""

TERMINATE_OTHER = int(
temporalio.api.enums.v1.ScheduleOverlapPolicy.SCHEDULE_OVERLAP_POLICY_TERMINATE_OTHER # pyright: ignore
temporalio.api.enums.v1.ScheduleOverlapPolicy.SCHEDULE_OVERLAP_POLICY_TERMINATE_OTHER
)
"""If there is another workflow running, terminate it and start the new one
immediately."""

ALLOW_ALL = int(
temporalio.api.enums.v1.ScheduleOverlapPolicy.SCHEDULE_OVERLAP_POLICY_ALLOW_ALL # pyright: ignore
temporalio.api.enums.v1.ScheduleOverlapPolicy.SCHEDULE_OVERLAP_POLICY_ALLOW_ALL
)
"""Start any number of concurrent workflows.
Expand Down

0 comments on commit 5efb27d

Please sign in to comment.