cron.go 347 B

1234567891011121314151617
  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. "github.com/robfig/cron"
  7. "github.com/gogits/gogs/models"
  8. )
  9. func NewCronContext() {
  10. c := cron.New()
  11. c.AddFunc("@every 1h", models.MirrorUpdate)
  12. c.Start()
  13. }