do not init caching for asset requests in domain-server

This commit is contained in:
Stephen Birarda 2018-02-21 14:15:39 -08:00
parent 6e6f52236e
commit 946474c615
7 changed files with 7 additions and 10 deletions

View file

@ -735,7 +735,6 @@ void DomainServer::setupNodeListAndAssignments() {
_assetClientThread.setObjectName("AssetClient Thread");
auto assetClient = DependencyManager::set<AssetClient>();
assetClient->moveToThread(&_assetClientThread);
QObject::connect(&_assetClientThread, &QThread::started, assetClient.data(), &AssetClient::init);
_assetClientThread.start();
// add whatever static assignments that have been parsed to the queue

View file

@ -53,7 +53,7 @@ AssetClient::AssetClient() {
this, &AssetClient::handleNodeClientConnectionReset);
}
void AssetClient::init() {
void AssetClient::initCaching() {
Q_ASSERT(QThread::currentThread() == thread());
// Setup disk cache if not already

View file

@ -64,7 +64,7 @@ public:
Q_INVOKABLE AssetUpload* createUpload(const QByteArray& data);
public slots:
void init();
void initCaching();
void cacheInfoRequest(QObject* reciever, QString slot);
MiniPromise::Promise cacheInfoRequestAsync(MiniPromise::Promise deferred = nullptr);

View file

@ -72,9 +72,8 @@ QByteArray loadFromCache(const QUrl& url) {
qCDebug(asset_client) << url.toDisplayString() << "not in disk cache";
}
} else {
qCWarning(asset_client) << "No disk cache to load assets from.";
}
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.";
}
} else {
qCWarning(asset_client) << "No disk cache to save assets to.";
}
return false;
}

View file

@ -47,7 +47,7 @@ bool BaseAssetScriptingInterface::initializeCache() {
}
// attempt to initialize the cache
QMetaObject::invokeMethod(assetClient().data(), "init");
QMetaObject::invokeMethod(assetClient().data(), "initCaching");
Promise deferred = makePromise("BaseAssetScriptingInterface--queryCacheStatus");
deferred->then([this](QVariantMap result) {

View file

@ -31,7 +31,7 @@ ResourceManager::ResourceManager() {
auto assetClient = DependencyManager::set<AssetClient>();
assetClient->moveToThread(&_thread);
QObject::connect(&_thread, &QThread::started, assetClient.data(), &AssetClient::init);
QObject::connect(&_thread, &QThread::started, assetClient.data(), &AssetClient::initCaching);
_thread.start();
}

View file

@ -197,7 +197,7 @@ ATPClientApp::ATPClientApp(int argc, char* argv[]) :
}
auto assetClient = DependencyManager::set<AssetClient>();
assetClient->init();
assetClient->initCaching();
if (_verbose) {
qDebug() << "domain-server address is" << _domainServerAddress;