db/Configured: log debug message when there is no cache directory
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1525
This commit is contained in:
parent
de4bdfcd1f
commit
ae85c2a979
@ -5,12 +5,14 @@
|
|||||||
#include "DatabaseGlue.hxx"
|
#include "DatabaseGlue.hxx"
|
||||||
#include "Interface.hxx"
|
#include "Interface.hxx"
|
||||||
#include "config/Data.hxx"
|
#include "config/Data.hxx"
|
||||||
|
#include "config/Domain.hxx"
|
||||||
#include "config/Param.hxx"
|
#include "config/Param.hxx"
|
||||||
#include "config/Block.hxx"
|
#include "config/Block.hxx"
|
||||||
#include "fs/AllocatedPath.hxx"
|
#include "fs/AllocatedPath.hxx"
|
||||||
#include "fs/FileSystem.hxx"
|
#include "fs/FileSystem.hxx"
|
||||||
#include "fs/glue/StandardDirectory.hxx"
|
#include "fs/glue/StandardDirectory.hxx"
|
||||||
#include "lib/fmt/RuntimeError.hxx"
|
#include "lib/fmt/RuntimeError.hxx"
|
||||||
|
#include "Log.hxx"
|
||||||
|
|
||||||
DatabasePtr
|
DatabasePtr
|
||||||
CreateConfiguredDatabase(const ConfigData &config,
|
CreateConfiguredDatabase(const ConfigData &config,
|
||||||
@ -37,8 +39,10 @@ CreateConfiguredDatabase(const ConfigData &config,
|
|||||||
/* if there is no override, use the cache directory */
|
/* if there is no override, use the cache directory */
|
||||||
|
|
||||||
const AllocatedPath cache_dir = GetAppCacheDir();
|
const AllocatedPath cache_dir = GetAppCacheDir();
|
||||||
if (cache_dir.IsNull())
|
if (cache_dir.IsNull()) {
|
||||||
|
FmtDebug(config_domain, "No cache directory; disabling the database");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
const auto db_file = cache_dir / Path::FromFS(PATH_LITERAL("db"));
|
const auto db_file = cache_dir / Path::FromFS(PATH_LITERAL("db"));
|
||||||
auto db_file_utf8 = db_file.ToUTF8();
|
auto db_file_utf8 = db_file.ToUTF8();
|
||||||
|
Loading…
Reference in New Issue
Block a user