| @@ -2,28 +2,11 @@ package timer | |||||
| import ( | import ( | ||||
| "github.com/robfig/cron/v3" | "github.com/robfig/cron/v3" | ||||
| //"time" | |||||
| "code.gitea.io/gitea/routers/repo" | "code.gitea.io/gitea/routers/repo" | ||||
| ) | ) | ||||
| /* | |||||
| const ( | |||||
| DecompressTimer = time.Minute * 10 | |||||
| ) | |||||
| */ | |||||
| func init() { | func init() { | ||||
| /* | |||||
| tiker := time.NewTicker(DecompressTimer) | |||||
| go func() { | |||||
| for { | |||||
| <-ticker.C | |||||
| repo.HandleUnDecompressAttachment() | |||||
| } | |||||
| }() | |||||
| */ | |||||
| c := cron.New() | c := cron.New() | ||||
| spec := "*/10 * * * *" | spec := "*/10 * * * *" | ||||
| c.AddFunc(spec, repo.HandleUnDecompressAttachment) | c.AddFunc(spec, repo.HandleUnDecompressAttachment) | ||||