From 692b0f18dfc11365b3491d19e0e3b9cfaac3ab03 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 24 Jul 2020 05:26:25 +0300 Subject: [PATCH] Drop only one week old empty queues from TQueue. GitOrigin-RevId: b7ce4c1b4471cfa385ca4d268e8e052db0896ef3 --- tddb/td/db/TQueue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tddb/td/db/TQueue.cpp b/tddb/td/db/TQueue.cpp index 33dda8e4c..086423adf 100644 --- a/tddb/td/db/TQueue.cpp +++ b/tddb/td/db/TQueue.cpp @@ -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++; } }