Skip to content

Commit bec8000

Browse files
Apply suggestion from @sebastianertz
Signed-off-by: Sebastian Ertz <sebastian.ertz@tk-ertz.de>
1 parent d72de31 commit bec8000

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

services/cron/cron.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ func ListTasks() TaskTable {
111111
spec = tags[1] // the second tag is the task spec
112112
}
113113
next, _ = e.NextRun()
114-
prev, _ = e.LastRunStartedAt()
114+
if ok, _ := e.IsRunning(); ok {
115+
prev, _ = e.LastRunCompletedAt()
116+
} else {
117+
prev, _ = e.LastRunStartedAt()
118+
}
115119
}
116120

117121
task.lock.Lock()

0 commit comments

Comments
 (0)