TQueue: fix adding already expired events.

GitOrigin-RevId: b78748cd001d9439c9e215b378b76b973a77a79a
This commit is contained in:
levlam 2020-08-16 02:57:31 +03:00
parent f266aa3912
commit e0caa301a5

View File

@ -147,6 +147,9 @@ class TQueueImpl : public TQueue {
if (q.total_event_length > MAX_TOTAL_EVENT_LENGTH - data.size()) {
return Status::Error("Queue size is too big");
}
if (expires_at <= 0) {
return Status::Error("Failed to add already expired event");
}
EventId event_id;
while (true) {
if (q.tail_id.empty()) {