registerKeysForActiveExpiration registers keys with TTL in the timing wheel for active expiration.
(records []*core.Record, entries []*core.Entry)
| 906 | |
| 907 | // registerKeysForActiveExpiration registers keys with TTL in the timing wheel for active expiration. |
| 908 | func (tx *Tx) registerKeysForActiveExpiration(records []*core.Record, entries []*core.Entry) { |
| 909 | if tx.db.ttlService == nil { |
| 910 | return |
| 911 | } |
| 912 | |
| 913 | for i, entry := range entries { |
| 914 | meta := entry.Meta |
| 915 | |
| 916 | if meta.TTL > 0 && meta.Flag != DataDeleteFlag { |
| 917 | record := records[i] |
| 918 | |
| 919 | if tx.db.ttlService.IsExpired(record.TTL, record.Timestamp) { |
| 920 | continue |
| 921 | } |
| 922 | |
| 923 | tx.db.ttlService.RegisterKeyForActiveExpiration( |
| 924 | meta.BucketId, |
| 925 | entry.Key, |
| 926 | meta.Ds, |
| 927 | meta.TTL, |
| 928 | meta.Timestamp, |
| 929 | ) |
| 930 | } |
| 931 | } |
| 932 | } |
no test coverage detected