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 735 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
123456789101112131415161718192021222324252627
  1. package timer
  2. import (
  3. "github.com/robfig/cron/v3"
  4. "code.gitea.io/gitea/routers/repo"
  5. )
  6. func init() {
  7. c := cron.New()
  8. spec := "*/10 * * * *"
  9. c.AddFunc(spec, repo.HandleUnDecompressAttachment)
  10. specCheckBlockChainUserSuccess := "*/10 * * * *"
  11. c.AddFunc(specCheckBlockChainUserSuccess, repo.HandleBlockChainUnSuccessUsers)
  12. specCheckRepoBlockChainSuccess := "*/5 * * * *"
  13. c.AddFunc(specCheckRepoBlockChainSuccess, repo.HandleBlockChainUnSuccessRepos)
  14. specCheckUnTransformedActions := "*/1 * * * *"
  15. c.AddFunc(specCheckUnTransformedActions, repo.HandleUnTransformedActions)
  16. specCheckBlockChainCommitSuccess := "*/3 * * * *"
  17. c.AddFunc(specCheckBlockChainCommitSuccess, repo.HandleBlockChainUnSuccessCommits)
  18. c.Start()
  19. }