mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-23 06:43:34 +01:00
Fix data-race bug when accessing task.LastRun (#27584)
This commit is contained in:
parent
fb74fe99d6
commit
1d155a43ad
1 changed files with 1 additions and 2 deletions
|
@ -107,12 +107,11 @@ func ListTasks() TaskTable {
|
|||
prev = e.PreviousRun()
|
||||
}
|
||||
|
||||
task.lock.Lock()
|
||||
// If the manual run is after the cron run, use that instead.
|
||||
if prev.Before(task.LastRun) {
|
||||
prev = task.LastRun
|
||||
}
|
||||
|
||||
task.lock.Lock()
|
||||
tTable = append(tTable, &TaskTableRow{
|
||||
Name: task.Name,
|
||||
Spec: spec,
|
||||
|
|
Loading…
Reference in a new issue