mirror of
				https://github.com/bjdgyc/anylink.git
				synced 2025-11-04 19:16:22 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			360 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			360 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.Cron("0 * * * *").Do(ClearUserActLog)
 | 
						|
	s.Every(1).Day().At("00:00").Do(sessdata.CloseUserLimittimeSession)
 | 
						|
	s.StartAsync()
 | 
						|
}
 |