refactor: Directly use shared URL from global setup

Previous we relyed on the watchdog providing a working shared URL (or
empty URL if no URL was reachable). This creates some overhead and
might not work in all cases because of the time between the call to
getWorkingSharedUrl() and the actual network request. Further, not all
calls that are fetching data from our servers were using the shared URL
from the watchdog anyway.
Lastly, this careful checking if the URL is available is only done for
the shared URL and not for all the other URLs that are queried by swift.
This commit is contained in:
Lars Toenning
2024-03-12 16:12:15 +01:00
parent 972de0777c
commit d31084db3a
6 changed files with 12 additions and 31 deletions

View File

@@ -723,17 +723,6 @@ namespace BlackCore
return m_networkWatchDog && m_networkWatchDog->isSwiftDbAccessible();
}
bool CApplication::hasWorkingSharedUrl() const
{
return m_networkWatchDog && m_networkWatchDog->hasWorkingSharedUrl();
}
CUrl CApplication::getWorkingSharedUrl() const
{
if (!m_networkWatchDog || !this->isNetworkAccessible()) { return CUrl(); }
return m_networkWatchDog->getWorkingSharedUrl();
}
void CApplication::exit(int retcode)
{
if (sApp) { instance()->gracefulShutdown(); }