diff options
author | Ethan Koenig <etk39@cornell.edu> | 2017-05-31 04:57:17 -0400 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-05-31 16:57:17 +0800 |
commit | bfb44f885468839259bc2ead999953cdd85654e1 (patch) | |
tree | 1b8b404133dad5ad4650d15a0a9acc6207fb916b /models/user.go | |
parent | 0f5b399e351786254f48dc1e5ed3419c3153703f (diff) | |
download | gitea-bfb44f885468839259bc2ead999953cdd85654e1.tar.gz gitea-bfb44f885468839259bc2ead999953cdd85654e1.zip |
Fix status table race condition (#1835)
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/models/user.go b/models/user.go index 3aef510d7c..8d8afdfdb8 100644 --- a/models/user.go +++ b/models/user.go @@ -1334,10 +1334,9 @@ func GetWatchedRepos(userID int64, private bool) ([]*Repository, error) { // SyncExternalUsers is used to synchronize users with external authorization source func SyncExternalUsers() { - if taskStatusTable.IsRunning(syncExternalUsers) { + if !taskStatusTable.StartIfNotRunning(syncExternalUsers) { return } - taskStatusTable.Start(syncExternalUsers) defer taskStatusTable.Stop(syncExternalUsers) log.Trace("Doing: SyncExternalUsers") |