Fix time service wrapper

This commit is contained in:
世界 2025-07-23 18:22:52 +08:00
parent 51e4330b8c
commit 83238d6a81
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4

View File

@ -11,10 +11,13 @@ type TimeServiceWrapper struct {
} }
func (w *TimeServiceWrapper) TimeFunc() func() time.Time { func (w *TimeServiceWrapper) TimeFunc() func() time.Time {
if w.TimeService == nil { return func() time.Time {
return nil if w.TimeService != nil {
return w.TimeService.TimeFunc()()
} else {
return time.Now()
}
} }
return w.TimeService.TimeFunc()
} }
func (w *TimeServiceWrapper) Upstream() any { func (w *TimeServiceWrapper) Upstream() any {