on startup, check integrity of cached files and remove old cached files

This commit is contained in:
josch
2014-12-30 14:01:48 +01:00
parent 9913f2948c
commit 3fbb3b01ff
4 changed files with 236 additions and 3 deletions

View File

@@ -319,6 +319,10 @@ static void open_hashtbl(const char *dircache, const char *filecache,
fclose(fp);
// TODO: make the maximum cache size configurable
// size is given in bytes and current default is 1 GiB
folder_tree_cleanup_filecache(*tree, 1073741824);
folder_tree_update(*tree, conn, false);
} else {
// file doesn't exist
@@ -456,7 +460,7 @@ int main(int argc, char *argv[])
ctx->sv_writefiles = stringv_alloc();
ctx->sv_readonlyfiles = stringv_alloc();
ctx->last_status_check = 0;
ctx->interval_status_check = 60;
ctx->interval_status_check = 60; // TODO: make this configurable
pthread_mutex_init(&(ctx->mutex), NULL);