Skip to content
This repository has been archived by the owner on Aug 19, 2018. It is now read-only.

Commit

Permalink
Make sure errors are thrown earlier if there are problems with the ba…
Browse files Browse the repository at this point in the history
…ckend configuration
  • Loading branch information
ddaeschler committed Aug 18, 2015
1 parent e2fd3b2 commit 3603c0e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions whip/AssetServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,24 @@ IAsyncStorageBackend::ptr AssetServer::selectStorageBackend(const std::string& b
{
IAsyncStorageBackend::ptr backend;

if (backendName == "vfs") {
if (boost::to_lower_copy(backendName) == "vfs") {
boost::shared_ptr<iwvfs::VFSBackend> vfs(new iwvfs::VFSBackend(storageRoot, enablePurge, _ioService, _pushReplicationSvc));

_index = vfs->getIndex();

backend = vfs;

} else if (backendName == "file") {
throw std::runtime_error("The file backend is deprecated");

}
return backend;
}

return backend;
throw std::runtime_error("disk_storage_backend must be vfs");
}

void AssetServer::configureStorage()
{
bool cachingEnabled = whip::Settings::instance().get("cache_enabled").as<bool>();
std::string diskStorageRoot = whip::Settings::instance().get("disk_storage_root").as<std::string>();
if (diskStorageRoot.empty()) throw std::runtime_error("disk_storage_root must be specified");

bool purgeEnabled = whip::Settings::instance().get("allow_purge").as<bool>();
std::string diskStorageBackend = whip::Settings::instance().get("disk_storage_backend").as<std::string>();
std::string migration = whip::Settings::instance().get("migration").as<std::string>();
Expand Down

0 comments on commit 3603c0e

Please sign in to comment.