MCPcopy Create free account
hub / github.com/python-arq/arq / CronJob

Class CronJob

arq/cron.py:93–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91
92@dataclass
93class CronJob:
94 name: str
95 coroutine: WorkerCoroutine
96 month: OptionType
97 day: OptionType
98 weekday: WeekdayOptionType
99 hour: OptionType
100 minute: OptionType
101 second: OptionType
102 microsecond: int
103 run_at_startup: bool
104 unique: bool
105 job_id: Optional[str]
106 timeout_s: Optional[float]
107 keep_result_s: Optional[float]
108 keep_result_forever: Optional[bool]
109 max_tries: Optional[int]
110 next_run: Optional[datetime] = None
111
112 def calculate_next(self, prev_run: datetime) -> None:
113 self.next_run = next_cron(
114 prev_run,
115 month=self.month,
116 day=self.day,
117 weekday=self.weekday,
118 hour=self.hour,
119 minute=self.minute,
120 second=self.second,
121 microsecond=self.microsecond,
122 )
123
124 def __repr__(self) -> str:
125 return '<CronJob {}>'.format(' '.join(f'{k}={v}' for k, v in self.__dict__.items()))
126
127
128def cron(

Callers 1

cronFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…