summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-02-22 08:39:54 +0100
committerdefault <nobody@localhost>2023-02-22 08:39:54 +0100
commit2bfebba7be63518f337663ec9a81a4be0de835f7 (patch)
treea637980ea3d963f75aa8decc48b34d732ccc64a1 /activitypub.c
parent372aa42125b2a4621d4b99e492360e553b5cc481 (diff)
Don't wait for 3 seconds if there were some q_items processed.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/activitypub.c b/activitypub.c
index 1d191b8..c05c859 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1160,9 +1160,10 @@ void process_user_queue_item(snac *snac, xs_dict *q_item)
}
-void process_user_queue(snac *snac)
+int process_user_queue(snac *snac)
/* processes a user's queue */
{
+ int cnt = 0;
xs *list = user_queue(snac);
xs_list *p = list;
@@ -1177,7 +1178,10 @@ void process_user_queue(snac *snac)
}
process_user_queue_item(snac, q_item);
+ cnt++;
}
+
+ return cnt;
}
@@ -1299,9 +1303,10 @@ void process_queue_item(xs_dict *q_item)
}
-void process_queue(void)
+int process_queue(void)
/* processes the global queue */
{
+ int cnt = 0;
xs *list = queue();
xs_list *p = list;
@@ -1310,9 +1315,13 @@ void process_queue(void)
while (xs_list_iter(&p, &fn)) {
xs *q_item = dequeue(fn);
- if (q_item != NULL)
+ if (q_item != NULL) {
job_post(q_item);
+ cnt++;
+ }
}
+
+ return cnt;
}