summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-11-08 18:15:51 +0100
committerGravatar default2023-11-08 18:15:51 +0100
commitb199f223e41a56c9c8e6dcf353cb64123d378879 (patch)
treea5bfa0f2f1f41525e5ab5cc006812d843b351bad
parentShow the "Search results for #tag" title. (diff)
downloadsnac2-b199f223e41a56c9c8e6dcf353cb64123d378879.tar.gz
snac2-b199f223e41a56c9c8e6dcf353cb64123d378879.tar.xz
snac2-b199f223e41a56c9c8e6dcf353cb64123d378879.zip
Tag indexes are also purged.
-rw-r--r--data.c20
-rw-r--r--mastoapi.c6
2 files changed, 22 insertions, 4 deletions
diff --git a/data.c b/data.c
index cd9c5e7..a544d1c 100644
--- a/data.c
+++ b/data.c
@@ -2498,7 +2498,25 @@ void purge_server(void)
2498 xs *itl_fn = xs_fmt("%s/public.idx", srv_basedir); 2498 xs *itl_fn = xs_fmt("%s/public.idx", srv_basedir);
2499 int itl_gc = index_gc(itl_fn); 2499 int itl_gc = index_gc(itl_fn);
2500 2500
2501 srv_debug(1, xs_fmt("purge: global (obj: %d, idx: %d, itl: %d)", cnt, icnt, itl_gc)); 2501 /* purge tag indexes */
2502 xs *tag_spec = xs_fmt("%s/tag/??", srv_basedir);
2503 xs *tag_dirs = xs_glob(tag_spec, 0, 0);
2504 p = tag_dirs;
2505
2506 int tag_gc = 0;
2507 while (xs_list_iter(&p, &v)) {
2508 xs *spec2 = xs_fmt("%s/" "*.idx", v);
2509 xs *files = xs_glob(spec2, 0, 0);
2510 xs_list *p2;
2511 xs_str *v2;
2512
2513 p2 = files;
2514 while (xs_list_iter(&p2, &v2))
2515 tag_gc += index_gc(v2);
2516 }
2517
2518 srv_debug(1, xs_fmt("purge: global "
2519 "(obj: %d, idx: %d, itl: %d, tag: %d)", cnt, icnt, itl_gc, tag_gc));
2502} 2520}
2503 2521
2504 2522
diff --git a/mastoapi.c b/mastoapi.c
index 55f685c..0c94dd9 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -1028,13 +1028,13 @@ int process_auth_token(snac *snac, const xs_dict *req)
1028 /* this counts as a 'login' */ 1028 /* this counts as a 'login' */
1029 lastlog_write(snac, "mastoapi"); 1029 lastlog_write(snac, "mastoapi");
1030 1030
1031 srv_debug(2, xs_fmt("mastoapi auth: valid token for user %s", uid)); 1031 srv_debug(2, xs_fmt("mastoapi auth: valid token for user '%s'", uid));
1032 } 1032 }
1033 else 1033 else
1034 srv_log(xs_fmt("mastoapi auth: corrupted token %s", tokid)); 1034 srv_log(xs_fmt("mastoapi auth: corrupted token '%s'", tokid));
1035 } 1035 }
1036 else 1036 else
1037 srv_log(xs_fmt("mastoapi auth: invalid token %s", tokid)); 1037 srv_log(xs_fmt("mastoapi auth: invalid token '%s'", tokid));
1038 } 1038 }
1039 1039
1040 return logged_in; 1040 return logged_in;