| 489 | } |
| 490 | |
| 491 | func (tx *Tx) CheckExpire(bucket string, key []byte) bool { |
| 492 | b, err := tx.db.bucketMgr.GetBucket(DataStructureList, bucket) |
| 493 | if err != nil { |
| 494 | return false |
| 495 | } |
| 496 | |
| 497 | var ( |
| 498 | bucketId = b.Id |
| 499 | l *data.List |
| 500 | exist bool |
| 501 | ) |
| 502 | |
| 503 | if l, exist = tx.db.Index.List.exist(bucketId); !exist { |
| 504 | return false |
| 505 | } |
| 506 | |
| 507 | if l.IsExpire(string(key)) { |
| 508 | _ = tx.push(bucket, key, DataDeleteFlag) |
| 509 | return true |
| 510 | } |
| 511 | return false |
| 512 | } |
| 513 | |
| 514 | func (tx *Tx) GetListTTL(bucket string, key []byte) (uint32, error) { |
| 515 | if err := tx.checkTxIsClosed(); err != nil { |