summaryrefslogtreecommitdiffstats
path: root/modules/cron
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2017-05-10 16:10:18 +0300
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2017-05-10 15:10:18 +0200
commit524885dd6502570dddf5c83f171ee74890dba5c4 (patch)
tree6256ab65739e8b2b9f4d9b498e10526341c2493c /modules/cron
parentfd76f090a29b229b9e8e089e225f7ca012809090 (diff)
downloadgitea-524885dd6502570dddf5c83f171ee74890dba5c4.tar.gz
gitea-524885dd6502570dddf5c83f171ee74890dba5c4.zip
LDAP user synchronization (#1478)
Diffstat (limited to 'modules/cron')
-rw-r--r--modules/cron/cron.go11
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()
}