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