Ignore duplicate SetPollAnswer logevent.

GitOrigin-RevId: 93a75f66765c7e578ededa16b03d21385182db3d
This commit is contained in:
levlam 2019-07-27 23:16:22 +03:00
parent 981d2bd8fe
commit dd3cc765ba

View File

@ -603,7 +603,11 @@ void PollManager::do_set_poll_answer(PollId poll_id, FullMessageId full_message_
return; return;
} }
CHECK(pending_answer.logevent_id_ == 0 || logevent_id == 0); if (pending_answer.logevent_id_ != 0 && logevent_id != 0) {
LOG(ERROR) << "Duplicate SetPollAnswer log event: " << pending_answer.logevent_id_ << " and " << logevent_id;
binlog_erase(G()->td_db()->get_binlog(), logevent_id);
return;
}
if (logevent_id == 0 && G()->parameters().use_message_db) { if (logevent_id == 0 && G()->parameters().use_message_db) {
SetPollAnswerLogEvent logevent; SetPollAnswerLogEvent logevent;
logevent.poll_id_ = poll_id; logevent.poll_id_ = poll_id;