grid2: check if profitStats.Since.IsZero

This commit is contained in:
c9s 2023-04-26 23:36:53 +08:00
parent f1919a2b43
commit b358cec235
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -33,7 +33,7 @@ func (f *ProfitFixer) Fix(parent context.Context, since, until time.Time, initia
defer log.Infof("profitFixer: done")
if profitStats.Since != nil && profitStats.Since.Before(since) {
if profitStats.Since != nil && !profitStats.Since.IsZero() && profitStats.Since.Before(since) {
log.Infof("profitFixer: profitStats.since %s is ealier than the given since %s, setting since to %s", profitStats.Since, since, profitStats.Since)
since = *profitStats.Since
}