Support NetQueryCreator without Scheduler.
This commit is contained in:
parent
69c2315c10
commit
38fe2d7cb2
@ -22,7 +22,8 @@
|
|||||||
namespace td {
|
namespace td {
|
||||||
|
|
||||||
NetQueryCreator::NetQueryCreator(std::shared_ptr<NetQueryStats> net_query_stats)
|
NetQueryCreator::NetQueryCreator(std::shared_ptr<NetQueryStats> net_query_stats)
|
||||||
: net_query_stats_(std::move(net_query_stats)), current_scheduler_id_(Scheduler::instance()->sched_id()) {
|
: net_query_stats_(std::move(net_query_stats))
|
||||||
|
, current_scheduler_id_(Scheduler::instance() == nullptr ? -2 : Scheduler::instance()->sched_id()) {
|
||||||
object_pool_.set_check_empty(true);
|
object_pool_.set_check_empty(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +45,8 @@ NetQueryPtr NetQueryCreator::create(uint64 id, const telegram_api::Function &fun
|
|||||||
int32 tl_constructor = function.get_id();
|
int32 tl_constructor = function.get_id();
|
||||||
int32 total_timeout_limit = 60;
|
int32 total_timeout_limit = 60;
|
||||||
|
|
||||||
if (current_scheduler_id_ == Scheduler::instance()->sched_id() && !G()->close_flag()) {
|
if (Scheduler::instance() != nullptr && current_scheduler_id_ == Scheduler::instance()->sched_id() &&
|
||||||
|
!G()->close_flag()) {
|
||||||
auto td = G()->td();
|
auto td = G()->td();
|
||||||
if (!td.empty()) {
|
if (!td.empty()) {
|
||||||
auto auth_manager = td.get_actor_unsafe()->auth_manager_.get();
|
auto auth_manager = td.get_actor_unsafe()->auth_manager_.get();
|
||||||
|
Loading…
Reference in New Issue
Block a user