You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
660 B

  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package cron
  5. import (
  6. "fmt"
  7. "github.com/gogits/gogs/models"
  8. "github.com/gogits/gogs/modules/setting"
  9. )
  10. var c = New()
  11. func NewCronContext() {
  12. c.AddFunc("Update mirrors", "@every 1h", models.MirrorUpdate)
  13. if setting.Git.Fsck.Enable {
  14. c.AddFunc("Repository health check", fmt.Sprintf("@every %dh", setting.Git.Fsck.Interval), models.GitFsck)
  15. }
  16. c.AddFunc("Check repository statistics", "@every 24h", models.CheckRepoStats)
  17. c.Start()
  18. }
  19. func ListEntries() []*Entry {
  20. return c.Entries()
  21. }