mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 03:48:38 +02:00
Merge pull request #12457 from birarda/feat/disable-ds-asset-client-caching
disable caching for asset requests in domain-server
This commit is contained in:
commit
3f9ee4918e
7 changed files with 7 additions and 10 deletions
|
@ -735,7 +735,6 @@ void DomainServer::setupNodeListAndAssignments() {
|
||||||
_assetClientThread.setObjectName("AssetClient Thread");
|
_assetClientThread.setObjectName("AssetClient Thread");
|
||||||
auto assetClient = DependencyManager::set<AssetClient>();
|
auto assetClient = DependencyManager::set<AssetClient>();
|
||||||
assetClient->moveToThread(&_assetClientThread);
|
assetClient->moveToThread(&_assetClientThread);
|
||||||
QObject::connect(&_assetClientThread, &QThread::started, assetClient.data(), &AssetClient::init);
|
|
||||||
_assetClientThread.start();
|
_assetClientThread.start();
|
||||||
|
|
||||||
// add whatever static assignments that have been parsed to the queue
|
// add whatever static assignments that have been parsed to the queue
|
||||||
|
|
|
@ -53,7 +53,7 @@ AssetClient::AssetClient() {
|
||||||
this, &AssetClient::handleNodeClientConnectionReset);
|
this, &AssetClient::handleNodeClientConnectionReset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssetClient::init() {
|
void AssetClient::initCaching() {
|
||||||
Q_ASSERT(QThread::currentThread() == thread());
|
Q_ASSERT(QThread::currentThread() == thread());
|
||||||
|
|
||||||
// Setup disk cache if not already
|
// Setup disk cache if not already
|
||||||
|
|
|
@ -64,7 +64,7 @@ public:
|
||||||
Q_INVOKABLE AssetUpload* createUpload(const QByteArray& data);
|
Q_INVOKABLE AssetUpload* createUpload(const QByteArray& data);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void init();
|
void initCaching();
|
||||||
|
|
||||||
void cacheInfoRequest(QObject* reciever, QString slot);
|
void cacheInfoRequest(QObject* reciever, QString slot);
|
||||||
MiniPromise::Promise cacheInfoRequestAsync(MiniPromise::Promise deferred = nullptr);
|
MiniPromise::Promise cacheInfoRequestAsync(MiniPromise::Promise deferred = nullptr);
|
||||||
|
|
|
@ -72,9 +72,8 @@ QByteArray loadFromCache(const QUrl& url) {
|
||||||
qCDebug(asset_client) << url.toDisplayString() << "not in disk cache";
|
qCDebug(asset_client) << url.toDisplayString() << "not in disk cache";
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
qCWarning(asset_client) << "No disk cache to load assets from.";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return QByteArray();
|
return QByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,9 +95,8 @@ bool saveToCache(const QUrl& url, const QByteArray& file) {
|
||||||
}
|
}
|
||||||
qCWarning(asset_client) << "Could not save" << url.toDisplayString() << "to disk cache.";
|
qCWarning(asset_client) << "Could not save" << url.toDisplayString() << "to disk cache.";
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
qCWarning(asset_client) << "No disk cache to save assets to.";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ bool BaseAssetScriptingInterface::initializeCache() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// attempt to initialize the cache
|
// attempt to initialize the cache
|
||||||
QMetaObject::invokeMethod(assetClient().data(), "init");
|
QMetaObject::invokeMethod(assetClient().data(), "initCaching");
|
||||||
|
|
||||||
Promise deferred = makePromise("BaseAssetScriptingInterface--queryCacheStatus");
|
Promise deferred = makePromise("BaseAssetScriptingInterface--queryCacheStatus");
|
||||||
deferred->then([this](QVariantMap result) {
|
deferred->then([this](QVariantMap result) {
|
||||||
|
|
|
@ -31,7 +31,7 @@ ResourceManager::ResourceManager() {
|
||||||
|
|
||||||
auto assetClient = DependencyManager::set<AssetClient>();
|
auto assetClient = DependencyManager::set<AssetClient>();
|
||||||
assetClient->moveToThread(&_thread);
|
assetClient->moveToThread(&_thread);
|
||||||
QObject::connect(&_thread, &QThread::started, assetClient.data(), &AssetClient::init);
|
QObject::connect(&_thread, &QThread::started, assetClient.data(), &AssetClient::initCaching);
|
||||||
|
|
||||||
_thread.start();
|
_thread.start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,7 +197,7 @@ ATPClientApp::ATPClientApp(int argc, char* argv[]) :
|
||||||
}
|
}
|
||||||
|
|
||||||
auto assetClient = DependencyManager::set<AssetClient>();
|
auto assetClient = DependencyManager::set<AssetClient>();
|
||||||
assetClient->init();
|
assetClient->initCaching();
|
||||||
|
|
||||||
if (_verbose) {
|
if (_verbose) {
|
||||||
qDebug() << "domain-server address is" << _domainServerAddress;
|
qDebug() << "domain-server address is" << _domainServerAddress;
|
||||||
|
|
Loading…
Reference in a new issue