Skip fix if hasnt nanoseconds

pull/659/head
elbandi 6 months ago
parent 6c2f935b1c
commit 252b3ad72d

@ -258,15 +258,14 @@ func (b *BaseDB) FixFaultyTimestamps(ctx context.Context) error {
}()
for _, swap := range loopOutSwaps {
// Get the year of the timestamp.
year, err := getTimeStampYear(swap.PublicationDeadline)
parsedTime, err := parseLayouts(defaultLayouts(), swap.PublicationDeadline)
if err != nil {
return err
return fmt.Errorf("unable to parse timestamp %v: %v",
swap.PublicationDeadline, err)
}
// Skip if the year is not in the future.
thisYear := time.Now().Year()
if year > 2020 && year <= thisYear {
// Skip if hasnt nanoseconds.
if parsedTime.Nanosecond() == 0 {
continue
}

Loading…
Cancel
Save