mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-03 08:55:20 +02:00
Fix status table race condition (#1835)
This commit is contained in:
parent
0f5b399e35
commit
bfb44f8854
5 changed files with 26 additions and 10 deletions
|
@ -202,10 +202,9 @@ func DeleteMirrorByRepoID(repoID int64) error {
|
|||
|
||||
// MirrorUpdate checks and updates mirror repositories.
|
||||
func MirrorUpdate() {
|
||||
if taskStatusTable.IsRunning(mirrorUpdate) {
|
||||
if !taskStatusTable.StartIfNotRunning(mirrorUpdate) {
|
||||
return
|
||||
}
|
||||
taskStatusTable.Start(mirrorUpdate)
|
||||
defer taskStatusTable.Stop(mirrorUpdate)
|
||||
|
||||
log.Trace("Doing: MirrorUpdate")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue