mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-05 09:05:14 +00:00
Add download sessions if it works fast enough.
This commit is contained in:
@@ -85,6 +85,9 @@ public:
|
||||
void badConfigurationError();
|
||||
void syncHttpUnixtime();
|
||||
|
||||
void restartedByTimeout(ShiftedDcId shiftedDcId);
|
||||
[[nodiscard]] rpl::producer<ShiftedDcId> restartsByTimeout() const;
|
||||
|
||||
void restart();
|
||||
void restart(ShiftedDcId shiftedDcId);
|
||||
[[nodiscard]] int32 dcstate(ShiftedDcId shiftedDcId = 0);
|
||||
@@ -208,6 +211,7 @@ private:
|
||||
Session *_mainSession = nullptr;
|
||||
base::flat_map<ShiftedDcId, std::unique_ptr<Session>> _sessions;
|
||||
std::vector<std::unique_ptr<Session>> _sessionsToDestroy;
|
||||
rpl::event_stream<ShiftedDcId> _restartsByTimeout;
|
||||
|
||||
std::unique_ptr<ConfigLoader> _configLoader;
|
||||
std::unique_ptr<DomainResolver> _domainResolver;
|
||||
@@ -446,6 +450,14 @@ void Instance::Private::syncHttpUnixtime() {
|
||||
});
|
||||
}
|
||||
|
||||
void Instance::Private::restartedByTimeout(ShiftedDcId shiftedDcId) {
|
||||
_restartsByTimeout.fire_copy(shiftedDcId);
|
||||
}
|
||||
|
||||
rpl::producer<ShiftedDcId> Instance::Private::restartsByTimeout() const {
|
||||
return _restartsByTimeout.events();
|
||||
}
|
||||
|
||||
void Instance::Private::requestConfigIfOld() {
|
||||
const auto timeout = Global::BlockedMode()
|
||||
? kConfigBecomesOldForBlockedIn
|
||||
@@ -1664,6 +1676,14 @@ void Instance::syncHttpUnixtime() {
|
||||
_private->syncHttpUnixtime();
|
||||
}
|
||||
|
||||
void Instance::restartedByTimeout(ShiftedDcId shiftedDcId) {
|
||||
_private->restartedByTimeout(shiftedDcId);
|
||||
}
|
||||
|
||||
rpl::producer<ShiftedDcId> Instance::restartsByTimeout() const {
|
||||
return _private->restartsByTimeout();
|
||||
}
|
||||
|
||||
void Instance::requestConfigIfOld() {
|
||||
_private->requestConfigIfOld();
|
||||
}
|
||||
|
Reference in New Issue
Block a user