Remove Unix() invocations on 'time.Time' objects and removed conversion of time to UTC

This commit is contained in:
vishalnayak
2016-07-07 17:44:14 -04:00
parent d274bcb8e6
commit f59a69bc52
31 changed files with 154 additions and 130 deletions

View File

@@ -450,9 +450,9 @@ func (b *Backend) handleWALRollback(
if age == 0 {
age = 10 * time.Minute
}
minAge := time.Now().UTC().Add(-1 * age)
minAge := time.Now().Add(-1 * age)
if _, ok := req.Data["immediate"]; ok {
minAge = time.Now().UTC().Add(1000 * time.Hour)
minAge = time.Now().Add(1000 * time.Hour)
}
for _, k := range keys {
@@ -466,7 +466,7 @@ func (b *Backend) handleWALRollback(
}
// If the entry isn't old enough, then don't roll it back
if !time.Unix(entry.CreatedAt, 0).Before(minAge) {
if !entry.CreatedAt.Before(minAge) {
continue
}