mirror of
https://github.com/PaiGramTeam/telegram-bot-api.git
synced 2024-11-23 07:50:54 +00:00
Update TDLib and asynchronously destroy deleted TQueue events.
This commit is contained in:
parent
452a190094
commit
1b741dd3b3
2
td
2
td
@ -1 +1 @@
|
|||||||
Subproject commit ac0de06b5f55e7bb5c2904ed6ef3aeb8c2df8c85
|
Subproject commit eeb73d4eb22d201655ed30e0e5b76ced3ef2323f
|
@ -5292,7 +5292,8 @@ void Client::timeout_expired() {
|
|||||||
void Client::clear_tqueue() {
|
void Client::clear_tqueue() {
|
||||||
CHECK(webhook_id_.empty());
|
CHECK(webhook_id_.empty());
|
||||||
auto &tqueue = parameters_->shared_data_->tqueue_;
|
auto &tqueue = parameters_->shared_data_->tqueue_;
|
||||||
tqueue->clear(tqueue_id_, 0);
|
auto deleted_events = tqueue->clear(tqueue_id_, 0);
|
||||||
|
td::Scheduler::instance()->destroy_on_scheduler(SharedData::get_file_gc_scheduler_id(), deleted_events);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::to_bool(td::MutableSlice value) {
|
bool Client::to_bool(td::MutableSlice value) {
|
||||||
@ -9533,7 +9534,8 @@ void Client::do_get_updates(int32 offset, int32 limit, int32 timeout, PromisedQu
|
|||||||
LOG(DEBUG) << "Queue head = " << tqueue->get_head(tqueue_id_) << ", queue tail = " << tqueue->get_tail(tqueue_id_);
|
LOG(DEBUG) << "Queue head = " << tqueue->get_head(tqueue_id_) << ", queue tail = " << tqueue->get_tail(tqueue_id_);
|
||||||
|
|
||||||
if (offset < 0) {
|
if (offset < 0) {
|
||||||
tqueue->clear(tqueue_id_, -offset);
|
auto deleted_events = tqueue->clear(tqueue_id_, -offset);
|
||||||
|
td::Scheduler::instance()->destroy_on_scheduler(SharedData::get_file_gc_scheduler_id(), deleted_events);
|
||||||
}
|
}
|
||||||
if (offset <= 0) {
|
if (offset <= 0) {
|
||||||
offset = tqueue->get_head(tqueue_id_).value();
|
offset = tqueue->get_head(tqueue_id_).value();
|
||||||
|
Loading…
Reference in New Issue
Block a user