@@ -128,16 +128,16 @@ def prepare_for_execution(self, worker_name: str, registry: JobNamesRegistry, co
128
128
self .last_heartbeat = utils .utcnow ()
129
129
self .started_at = self .last_heartbeat
130
130
self .status = JobStatus .STARTED
131
- registry .add (connection , self .name , self .last_heartbeat .timestamp ())
131
+ registry .add (connection , self .name , self .last_heartbeat .timestamp () + self . job_info_ttl )
132
132
self .save (connection = connection )
133
133
134
134
def after_execution (
135
- self ,
136
- job_info_ttl : int ,
137
- status : JobStatus ,
138
- connection : ConnectionType ,
139
- prev_registry : Optional [JobNamesRegistry ] = None ,
140
- new_registry : Optional [JobNamesRegistry ] = None ,
135
+ self ,
136
+ job_info_ttl : int ,
137
+ status : JobStatus ,
138
+ connection : ConnectionType ,
139
+ prev_registry : Optional [JobNamesRegistry ] = None ,
140
+ new_registry : Optional [JobNamesRegistry ] = None ,
141
141
) -> None :
142
142
"""After the job is executed, update the status, heartbeat, and other metadata."""
143
143
self .status = status
@@ -190,26 +190,26 @@ def deserialize(cls, data: Dict[str, Any]) -> Self:
190
190
191
191
@classmethod
192
192
def create (
193
- cls ,
194
- connection : ConnectionType ,
195
- func : FunctionReferenceType ,
196
- queue_name : str ,
197
- args : Union [List [Any ], Optional [Tuple ]] = None ,
198
- kwargs : Optional [Dict [str , Any ]] = None ,
199
- result_ttl : Optional [int ] = None ,
200
- job_info_ttl : Optional [int ] = None ,
201
- status : Optional [JobStatus ] = None ,
202
- description : Optional [str ] = None ,
203
- timeout : Optional [int ] = None ,
204
- name : Optional [str ] = None ,
205
- task_type : Optional [str ] = None ,
206
- scheduled_task_id : Optional [int ] = None ,
207
- meta : Optional [Dict [str , Any ]] = None ,
208
- * ,
209
- on_success : Optional [Callback ] = None ,
210
- on_failure : Optional [Callback ] = None ,
211
- on_stopped : Optional [Callback ] = None ,
212
- at_front : Optional [bool ] = None ,
193
+ cls ,
194
+ connection : ConnectionType ,
195
+ func : FunctionReferenceType ,
196
+ queue_name : str ,
197
+ args : Union [List [Any ], Optional [Tuple ]] = None ,
198
+ kwargs : Optional [Dict [str , Any ]] = None ,
199
+ result_ttl : Optional [int ] = None ,
200
+ job_info_ttl : Optional [int ] = None ,
201
+ status : Optional [JobStatus ] = None ,
202
+ description : Optional [str ] = None ,
203
+ timeout : Optional [int ] = None ,
204
+ name : Optional [str ] = None ,
205
+ task_type : Optional [str ] = None ,
206
+ scheduled_task_id : Optional [int ] = None ,
207
+ meta : Optional [Dict [str , Any ]] = None ,
208
+ * ,
209
+ on_success : Optional [Callback ] = None ,
210
+ on_failure : Optional [Callback ] = None ,
211
+ on_stopped : Optional [Callback ] = None ,
212
+ at_front : Optional [bool ] = None ,
213
213
) -> Self :
214
214
"""Creates a new job-model for the given function, arguments, and keyword arguments.
215
215
:returns: A job-model instance.
@@ -283,7 +283,7 @@ def create(
283
283
284
284
285
285
def _get_call_string (
286
- func_name : Optional [str ], args : Any , kwargs : Dict [Any , Any ], max_length : Optional [int ] = None
286
+ func_name : Optional [str ], args : Any , kwargs : Dict [Any , Any ], max_length : Optional [int ] = None
287
287
) -> Optional [str ]:
288
288
"""
289
289
Returns a string representation of the call, formatted as a regular
0 commit comments