Save correct config expire time, but still reget config on every restart.
GitOrigin-RevId: 6aa14c424b159def6ca0ebc9dad0ddbe13010854
This commit is contained in:
parent
e2053c3239
commit
ba1c2781d8
@ -885,7 +885,7 @@ void ConfigManager::start_up() {
|
|||||||
send_closure(config_recoverer_, &ConfigRecoverer::on_dc_options_update, load_dc_options_update());
|
send_closure(config_recoverer_, &ConfigRecoverer::on_dc_options_update, load_dc_options_update());
|
||||||
|
|
||||||
auto expire_time = load_config_expire_time();
|
auto expire_time = load_config_expire_time();
|
||||||
if (expire_time.is_in_past()) {
|
if (expire_time.is_in_past() || true) {
|
||||||
request_config();
|
request_config();
|
||||||
} else {
|
} else {
|
||||||
expire_time_ = expire_time;
|
expire_time_ = expire_time;
|
||||||
@ -1316,8 +1316,7 @@ Timestamp ConfigManager::load_config_expire_time() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ConfigManager::save_config_expire(Timestamp timestamp) {
|
void ConfigManager::save_config_expire(Timestamp timestamp) {
|
||||||
G()->td_db()->get_binlog_pmc()->set("config_expire",
|
G()->td_db()->get_binlog_pmc()->set("config_expire", to_string(static_cast<int>(Clocks::system() + timestamp.in())));
|
||||||
to_string(static_cast<int>(Clocks::system() + expire_time_.in())));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigManager::process_config(tl_object_ptr<telegram_api::config> config) {
|
void ConfigManager::process_config(tl_object_ptr<telegram_api::config> config) {
|
||||||
|
@ -153,10 +153,10 @@ class ConfigManager : public NetQueryCallback {
|
|||||||
|
|
||||||
void do_dismiss_suggested_action(SuggestedAction suggested_action);
|
void do_dismiss_suggested_action(SuggestedAction suggested_action);
|
||||||
|
|
||||||
Timestamp load_config_expire_time();
|
static Timestamp load_config_expire_time();
|
||||||
void save_config_expire(Timestamp timestamp);
|
static void save_config_expire(Timestamp timestamp);
|
||||||
void save_dc_options_update(DcOptions dc_options);
|
static void save_dc_options_update(DcOptions dc_options);
|
||||||
DcOptions load_dc_options_update();
|
static DcOptions load_dc_options_update();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace td
|
} // namespace td
|
||||||
|
Loading…
Reference in New Issue
Block a user