Skip to content

Commit

Permalink
as time.Time
Browse files Browse the repository at this point in the history
  • Loading branch information
jh-bate committed Dec 12, 2023
1 parent 1cf7e58 commit fbeb0f8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (m *Migration) execute() error {

func (m *Migration) getOplogDuration() (time.Duration, error) {
type MongoMetaData struct {
Wall int64 `json:"wall"`
Wall time.Time `json:"wall"`
}

log.Println("checking oplog duration ")
Expand All @@ -239,9 +239,9 @@ func (m *Migration) getOplogDuration() (time.Duration, error) {
log.Printf("newest walltime mongo err %v", err)
return 0, err
}
oldestT := time.UnixMilli(oldest.Wall)
newestT := time.UnixMilli(newest.Wall)
oplogDuration := newestT.Sub(oldestT)
//oldestT := time.UnixMilli(oldest.Wall)
//newestT := time.UnixMilli(newest.Wall)
oplogDuration := newest.Wall.Sub(oldest.Wall)
log.Printf("oplog duration is currently: %v", oplogDuration)
return oplogDuration, nil
}
Expand Down

0 comments on commit fbeb0f8

Please sign in to comment.