Skip to content

Commit 8c545c9

Browse files
committed
Inline nested ifs
1 parent ec18a99 commit 8c545c9

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

azure/durable_functions/models/DurableOrchestrationContext.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -600,14 +600,15 @@ def create_timer(self, fire_at: datetime.datetime) -> TaskBase:
600600
TaskBase
601601
A Durable Timer Task that schedules the timer to wake up the activity
602602
"""
603-
if self._replay_schema.value >= ReplaySchema.V3.value:
604-
if self._maximum_short_timer_duration and self._long_timer_interval_duration:
605-
# These values not provided for DTS or MSSQL, so skip the LongTimerTask
606-
# and create the TimerTask as normal
607-
608-
if fire_at > self.current_utc_datetime + self._maximum_short_timer_duration:
609-
action = CreateTimerAction(fire_at)
610-
return LongTimerTask(None, action, self)
603+
if (self._replay_schema.value >= ReplaySchema.V3.value
604+
and self._maximum_short_timer_duration
605+
and self._long_timer_interval_duration
606+
and fire_at > self.current_utc_datetime + self._maximum_short_timer_duration):
607+
# Timer duration config values are not provided for DTS or MSSQL, so skip the
608+
# LongTimerTask and create the TimerTask as normal
609+
610+
action = CreateTimerAction(fire_at)
611+
return LongTimerTask(None, action, self)
611612

612613
action = CreateTimerAction(fire_at)
613614
task = self._generate_task(action, task_constructor=TimerTask)

0 commit comments

Comments
 (0)