diff options
author | default <nobody@localhost> | 2024-04-22 07:53:40 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2024-04-22 07:53:40 +0200 |
commit | 16a4a09e4fcc6f107649b3053747f2a2c68c0dea (patch) | |
tree | dd5cfba8341a6a01fe5ca1cff10e6df7fa9e9101 /activitypub.c | |
parent | cf1c2b1ed82b54e5496275c2bab4c828afbb2b06 (diff) |
New server.json knobs "queue_timeout" and "queue_timeout_2".
Diffstat (limited to 'activitypub.c')
-rw-r--r-- | activitypub.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/activitypub.c b/activitypub.c index 0ed764e..94c0d30 100644 --- a/activitypub.c +++ b/activitypub.c @@ -2371,6 +2371,7 @@ void process_queue_item(xs_dict *q_item) int p_status = xs_number_get(xs_dict_get(q_item, "p_status")); xs *payload = NULL; int p_size = 0; + int timeout = 0; if (xs_is_null(inbox) || xs_is_null(msg) || xs_is_null(keyid) || xs_is_null(seckey)) { srv_log(xs_fmt("output message error: missing fields")); @@ -2383,8 +2384,15 @@ void process_queue_item(xs_dict *q_item) } /* deliver (if previous error status was a timeout, try now longer) */ - status = send_to_inbox_raw(keyid, seckey, inbox, msg, - &payload, &p_size, p_status == 599 ? 8 : 6); + if (p_status == 599) + timeout = xs_number_get(xs_dict_get_def(srv_config, "queue_timeout_2", "8")); + else + timeout = xs_number_get(xs_dict_get_def(srv_config, "queue_timeout", "6")); + + if (timeout == 0) + timeout = 6; + + status = send_to_inbox_raw(keyid, seckey, inbox, msg, &payload, &p_size, timeout); if (payload) { if (p_size > 64) { |