mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 00:34:28 +08:00
support periodically cleaning up expired tokens
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"github.com/go-co-op/gocron/v2"
|
||||
|
||||
"github.com/mayswind/ezbookkeeping/pkg/log"
|
||||
)
|
||||
|
||||
// GocronLoggerAdapter represents the logger adapter for gocron
|
||||
type GocronLoggerAdapter struct {
|
||||
}
|
||||
|
||||
// Debug logs debug log
|
||||
func (logger GocronLoggerAdapter) Debug(msg string, args ...any) {
|
||||
log.Debugf(msg, args...)
|
||||
}
|
||||
|
||||
// Info logs info log
|
||||
func (logger GocronLoggerAdapter) Info(msg string, args ...any) {
|
||||
log.Infof(msg, args...)
|
||||
}
|
||||
|
||||
// Warn logs warn log
|
||||
func (logger GocronLoggerAdapter) Warn(msg string, args ...any) {
|
||||
log.Warnf(msg, args...)
|
||||
}
|
||||
|
||||
// Error logs error log
|
||||
func (logger GocronLoggerAdapter) Error(msg string, args ...any) {
|
||||
log.Errorf(msg, args...)
|
||||
}
|
||||
|
||||
// NewGocronLoggerAdapter returns a new GocronLoggerAdapter instance
|
||||
func NewGocronLoggerAdapter() gocron.Logger {
|
||||
return GocronLoggerAdapter{}
|
||||
}
|
||||
Reference in New Issue
Block a user