Move status table to cron package (#7370)

This commit is contained in:
Lunny Xiao 2019-07-16 08:13:03 +08:00 committed by techknowlogick
parent 760c473896
commit d2958d9f46
24 changed files with 687 additions and 501 deletions

View file

@ -60,8 +60,6 @@ const (
algoPbkdf2 = "pbkdf2"
)
const syncExternalUsers = "sync_external_users"
var (
// ErrUserNotKeyOwner user does not own this key error
ErrUserNotKeyOwner = errors.New("User does not own this public key")
@ -1643,11 +1641,6 @@ func synchronizeLdapSSHPublicKeys(usr *User, s *LoginSource, sshPublicKeys []str
// SyncExternalUsers is used to synchronize users with external authorization source
func SyncExternalUsers() {
if !taskStatusTable.StartIfNotRunning(syncExternalUsers) {
return
}
defer taskStatusTable.Stop(syncExternalUsers)
log.Trace("Doing: SyncExternalUsers")
ls, err := LoginSources()