Drop only one week old empty queues from TQueue.

GitOrigin-RevId: b7ce4c1b4471cfa385ca4d268e8e052db0896ef3
This commit is contained in:
levlam 2020-07-24 05:26:25 +03:00
parent 70534a8aca
commit 692b0f18df

View File

@ -219,7 +219,7 @@ class TQueueImpl : public TQueue {
size_t deleted_events = 0;
for (auto &e : it->second.events.as_mutable_span()) {
if (e.expires_at < now) {
pop(it->second, it->first, e, EventId());
pop(it->second, it->first, e, e.expires_at < now - 7 * 86400 ? EventId() : it->second.tail_id);
deleted_events++;
}
}