diff options
author | Lauris BH <lauris@nix.lv> | 2017-05-10 16:10:18 +0300 |
---|---|---|
committer | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2017-05-10 15:10:18 +0200 |
commit | 524885dd6502570dddf5c83f171ee74890dba5c4 (patch) | |
tree | 6256ab65739e8b2b9f4d9b498e10526341c2493c /modules/cron | |
parent | fd76f090a29b229b9e8e089e225f7ca012809090 (diff) | |
download | gitea-524885dd6502570dddf5c83f171ee74890dba5c4.tar.gz gitea-524885dd6502570dddf5c83f171ee74890dba5c4.zip |
LDAP user synchronization (#1478)
Diffstat (limited to 'modules/cron')
-rw-r--r-- | modules/cron/cron.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/cron/cron.go b/modules/cron/cron.go index 785bf44ada..a64b51253c 100644 --- a/modules/cron/cron.go +++ b/modules/cron/cron.go @@ -66,6 +66,17 @@ func NewContext() { go models.DeleteOldRepositoryArchives() } } + if setting.Cron.SyncExternalUsers.Enabled { + entry, err = c.AddFunc("Synchronize external users", setting.Cron.SyncExternalUsers.Schedule, models.SyncExternalUsers) + if err != nil { + log.Fatal(4, "Cron[Synchronize external users]: %v", err) + } + if setting.Cron.SyncExternalUsers.RunAtStart { + entry.Prev = time.Now() + entry.ExecTimes++ + go models.SyncExternalUsers() + } + } c.Start() } |