TQueue: fix adding already expired events.
GitOrigin-RevId: b78748cd001d9439c9e215b378b76b973a77a79a
This commit is contained in:
parent
f266aa3912
commit
e0caa301a5
|
@ -147,6 +147,9 @@ class TQueueImpl : public TQueue {
|
||||||
if (q.total_event_length > MAX_TOTAL_EVENT_LENGTH - data.size()) {
|
if (q.total_event_length > MAX_TOTAL_EVENT_LENGTH - data.size()) {
|
||||||
return Status::Error("Queue size is too big");
|
return Status::Error("Queue size is too big");
|
||||||
}
|
}
|
||||||
|
if (expires_at <= 0) {
|
||||||
|
return Status::Error("Failed to add already expired event");
|
||||||
|
}
|
||||||
EventId event_id;
|
EventId event_id;
|
||||||
while (true) {
|
while (true) {
|
||||||
if (q.tail_id.empty()) {
|
if (q.tail_id.empty()) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user