commit d8d40ac
grunfink
·
2026-01-19 14:53:19 +0000 UTC
parent 4e166a5
New command-line option 'refresh'.
2 files changed,
+17,
-2
M
main.c
+1,
-1
1@@ -3395,7 +3395,7 @@ void process_user_queue_item(snac *user, xs_dict *q_item)
2 actor_add(actor, actor_o);
3 }
4 else {
5- if (status == HTTP_STATUS_GONE) {
6+ if (status == HTTP_STATUS_GONE || status == HTTP_STATUS_NOT_FOUND) {
7 actor_failure(actor, 1);
8 snac_log(user, xs_fmt("actor_refresh marking actor %s as broken %d", actor, status));
9 }
M
main.c
+16,
-1
1@@ -77,7 +77,8 @@ int usage(const char *cmd)
2 "list_remove {basedir} {uid} {name} Removes an existing list\n"
3 "list_add {basedir} {uid} {name} {acct} Adds an account (@user@host or actor url) to a list\n"
4 "list_del {basedir} {uid} {name} {actor} Deletes an actor URL from a list\n"
5- "top_ten {basedir} {uid} [{N}] Prints the most popular posts\n";
6+ "top_ten {basedir} {uid} [{N}] Prints the most popular posts\n"
7+ "refresh {basedir} {uid} Refreshes all actors\n";
8
9 if (cmd == NULL)
10 printf("%s", cmds);
11@@ -369,6 +370,20 @@ int main(int argc, char *argv[])
12 return 0;
13 }
14
15+ if (strcmp(cmd, "refresh") == 0) { /** **/
16+ xs *fwers = follower_list(&snac);
17+ xs *fwing = following_list(&snac);
18+ const char *id;
19+
20+ xs_list_foreach(fwers, id)
21+ enqueue_actor_refresh(&snac, id, 0);
22+
23+ xs_list_foreach(fwing, id)
24+ enqueue_actor_refresh(&snac, id, 0);
25+
26+ return 0;
27+ }
28+
29 if ((url = GET_ARGV()) == NULL)
30 return usage(cmd);
31