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

timer.go 800 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930
  1. package timer
  2. import (
  3. "github.com/robfig/cron/v3"
  4. "code.gitea.io/gitea/modules/log"
  5. "code.gitea.io/gitea/routers/repo"
  6. )
  7. func LaunchCronJob() {
  8. log.Trace("Run cron job")
  9. c := cron.New()
  10. spec := "*/10 * * * *"
  11. c.AddFunc(spec, repo.HandleUnDecompressAttachment)
  12. specCheckBlockChainUserSuccess := "*/10 * * * *"
  13. c.AddFunc(specCheckBlockChainUserSuccess, repo.HandleBlockChainUnSuccessUsers)
  14. specCheckRepoBlockChainSuccess := "*/1 * * * *"
  15. c.AddFunc(specCheckRepoBlockChainSuccess, repo.HandleBlockChainUnSuccessRepos)
  16. specCheckUnTransformedPRs := "*/1 * * * *"
  17. c.AddFunc(specCheckUnTransformedPRs, repo.HandleBlockChainMergedPulls)
  18. specCheckBlockChainCommitSuccess := "*/3 * * * *"
  19. c.AddFunc(specCheckBlockChainCommitSuccess, repo.HandleBlockChainUnSuccessCommits)
  20. c.Start()
  21. }