Ignore failed to parse application log events.

This commit is contained in:
levlam 2023-02-21 13:38:56 +03:00
parent 947a3031f3
commit 466853496b

View File

@ -157,7 +157,11 @@ void on_save_app_log_binlog_event(Td *td, BinlogEvent &&event) {
CHECK(event.id_ != 0);
CHECK(event.type_ == LogEvent::HandlerType::SaveAppLog);
SaveAppLogLogEvent log_event;
log_event_parse(log_event, event.get_data()).ensure();
if (log_event_parse(log_event, event.get_data()).is_error()) {
LOG(ERROR) << "Failed to parse application log event";
binlog_erase(G()->td_db()->get_binlog(), event.id_);
return;
}
save_app_log_impl(td, std::move(log_event.input_app_event_out_), event.id_, Promise<Unit>());
}