mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 12:15:12 +00:00
[MOD] Verbosity levels, avatar cleanser
I have a weird bug where Parsee seems to hang on a Db request, been tryign to figure that otu since a while but can't quite put my finger on where. You can have this commit, as a treat.
This commit is contained in:
parent
3a60b773c9
commit
692cb8aa6f
19 changed files with 190 additions and 111 deletions
39
tools/noavatars.c
Normal file
39
tools/noavatars.c
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/* noavatars.c - Clean up the avatar cache
|
||||
* ============================================================
|
||||
* Under CC0, as its a rather useful example of a Parsee tool.
|
||||
* See LICENSE for more information about Parsee's licensing. */
|
||||
|
||||
#include <Cytoplasm/Memory.h>
|
||||
#include <Cytoplasm/Json.h>
|
||||
#include <Cytoplasm/Log.h>
|
||||
#include <Cytoplasm/Db.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
Main(Array *args, HashMap *env)
|
||||
{
|
||||
char *db_path, *exec;
|
||||
Db *parsee;
|
||||
|
||||
exec = ArrayGet(args, 0);
|
||||
|
||||
if (ArraySize(args) < 2)
|
||||
{
|
||||
Log(LOG_ERR, "Usage: %s [DB path]", exec);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
db_path = ArrayGet(args, 1);
|
||||
|
||||
parsee = DbOpenLMDB(db_path, 8 * 1024 * 1024);
|
||||
if (parsee)
|
||||
{
|
||||
DbDelete(parsee, 1, "avatars");
|
||||
DbClose(parsee);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Log(LOG_ERR, "%s: couldn't open DB '%s'", exec, db_path);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue