|
|
@@ -61,6 +61,8 @@ type Store interface {
|
|
|
|
|
|
JsonStats() []byte
|
|
|
DeleteExpiredKeys(cutoff time.Time)
|
|
|
+
|
|
|
+ HasTTLKeys() bool
|
|
|
}
|
|
|
|
|
|
type TTLOptionSet struct {
|
|
|
@@ -778,3 +780,9 @@ func (s *store) JsonStats() []byte {
|
|
|
s.Stats.Watchers = uint64(s.WatcherHub.count)
|
|
|
return s.Stats.toJson()
|
|
|
}
|
|
|
+
|
|
|
+func (s *store) HasTTLKeys() bool {
|
|
|
+ s.worldLock.RLock()
|
|
|
+ defer s.worldLock.RUnlock()
|
|
|
+ return s.ttlKeyHeap.Len() != 0
|
|
|
+}
|