Browse Source

fix time comparison

pull/1730/head
qieqieplus 4 years ago
committed by GitHub
parent
commit
b2e50f602f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      weed/filer/rocksdb/rocksdb_ttl.go

2
weed/filer/rocksdb/rocksdb_ttl.go

@ -29,7 +29,7 @@ func (t *TTLFilter) Filter(level int, key, val []byte) (remove bool, newVal []by
entry := filer.Entry{}
if err := entry.DecodeAttributesAndChunks(val); err == nil {
if entry.TtlSec == 0 ||
entry.Crtime.Add(time.Duration(entry.TtlSec)*time.Second).Before(time.Now()) {
entry.Crtime.Add(time.Duration(entry.TtlSec)*time.Second).After(time.Now()) {
return false, val
}
}

Loading…
Cancel
Save