1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-06-30 22:31:06 +02:00

fix time comparison

This commit is contained in:
qieqieplus 2021-01-05 19:36:40 +08:00 committed by GitHub
parent bbae13e415
commit b2e50f602f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}
}