You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a job is fast enough, it can happen that its status goes from created to finished, without ever being running. The started_at time is thus never set (source):
@event.listens_for(Job.status, "set")defjob_status_change_listener(job, new_status, old_status, initiator):
"""Job status change listener."""ifnew_status!=old_status:
from .databaseimportSessionifnew_statusin [
JobStatus.finished,
JobStatus.failed,
]:
job.finished_at=datetime.now()
elifnew_statusin [JobStatus.running]:
job.started_at=datetime.now()
Session.commit()
The starting times of jobs are not saved in the database. Note that, instead, finishing times are correctly persisted.
How to reproduce:
kubectl exec -it deployment/reana-db -- psql -U reana reana
started_at
is not set to any valueThe text was updated successfully, but these errors were encountered: