fix: actually store the queried timestamp in the struct

main^2
Max Ignatenko 2024-11-14 12:17:01 +00:00
parent 04f2f80a06
commit 2c6a7201ef
1 changed files with 4 additions and 4 deletions

View File

@ -112,11 +112,11 @@ func (m *Mirror) LastRecordTimestamp(ctx context.Context) (time.Time, error) {
m.mu.Lock()
defer m.mu.Unlock()
if t.IsZero() {
t = dbTimestamp
if m.lastRecordTimestamp.IsZero() {
m.lastRecordTimestamp = dbTimestamp
}
if t.After(dbTimestamp) {
return t, nil
if m.lastRecordTimestamp.After(dbTimestamp) {
return m.lastRecordTimestamp, nil
}
return dbTimestamp, nil
}