mirror of
				https://github.com/bjdgyc/anylink.git
				synced 2025-10-31 16:43:28 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			319 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			319 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package cron
 | |
| 
 | |
| import (
 | |
| 	"time"
 | |
| 
 | |
| 	"github.com/bjdgyc/anylink/sessdata"
 | |
| 	"github.com/go-co-op/gocron"
 | |
| )
 | |
| 
 | |
| func Start() {
 | |
| 	s := gocron.NewScheduler(time.Local)
 | |
| 	s.Cron("0 * * * *").Do(ClearAudit)
 | |
| 	s.Cron("0 * * * *").Do(ClearStatsInfo)
 | |
| 	s.Every(1).Day().At("00:00").Do(sessdata.CloseUserLimittimeSession)
 | |
| 	s.StartAsync()
 | |
| }
 |