mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 10:45:11 +00:00
[FIX] Fix minor DB fuckup with tools
Used to open a flatfile database whenever it couldn't find an LMDB one, which obviously caused *problems*
This commit is contained in:
parent
c2536c2e84
commit
1936be0078
2 changed files with 20 additions and 21 deletions
|
|
@ -89,31 +89,30 @@ Main(Array *args, HashMap *env)
|
|||
glob = ArrayGet(args, 2);
|
||||
|
||||
parsee = GetDB(db_path);
|
||||
if (parsee)
|
||||
if (!parsee)
|
||||
{
|
||||
Log(LOG_ERR, "%s: couldn't open config '%s' or couldnt edit DB", exec, db_path);
|
||||
(void) env;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (glob)
|
||||
{
|
||||
Log(LOG_NOTICE, "Adding glob '%s' to database %s", glob, db_path);
|
||||
AddAdmin(parsee, glob);
|
||||
Log(LOG_INFO, "Successfully added glob %s.", glob);
|
||||
Log(LOG_INFO, "*I'm jealous of all these admins!*");
|
||||
|
||||
DbClose(parsee);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
/* List admins */
|
||||
Log(LOG_INFO, "Admin list:");
|
||||
LogConfigIndent(LogConfigGlobal());
|
||||
ListAdmins(parsee);
|
||||
LogConfigUnindent(LogConfigGlobal());
|
||||
if (glob)
|
||||
{
|
||||
Log(LOG_NOTICE, "Adding glob '%s' to database %s", glob, db_path);
|
||||
AddAdmin(parsee, glob);
|
||||
Log(LOG_INFO, "Successfully added glob %s.", glob);
|
||||
Log(LOG_INFO, "*I'm jealous of all these admins!*");
|
||||
|
||||
DbClose(parsee);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Log(LOG_ERR, "%s: couldn't open config '%s' or couldnt edit DB", exec, db_path);
|
||||
(void) env;
|
||||
return EXIT_FAILURE;
|
||||
/* List admins */
|
||||
Log(LOG_INFO, "Admin list:");
|
||||
LogConfigIndent(LogConfigGlobal());
|
||||
ListAdmins(parsee);
|
||||
LogConfigUnindent(LogConfigGlobal());
|
||||
|
||||
DbClose(parsee);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ GetDB(char *config)
|
|||
{
|
||||
ret = DbOpenLMDB(db_path, lmdb_size);
|
||||
}
|
||||
if (!ret)
|
||||
else
|
||||
{
|
||||
ret = DbOpen(db_path, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue