Log unexpected q_item types.

This commit is contained in:
default 2023-02-07 13:19:27 +01:00
parent 7be01b7f34
commit 8f63c6259a

View file

@ -1126,20 +1126,20 @@ void process_user_queue_item(snac *snac, xs_dict *q_item)
/* deliver */ /* deliver */
status = send_to_inbox_raw(keyid, seckey, inbox, msg, &payload, &p_size, retries == 0 ? 3 : 8); status = send_to_inbox_raw(keyid, seckey, inbox, msg, &payload, &p_size, retries == 0 ? 3 : 8);
snac_log(snac, xs_fmt("process_queue sent to inbox %s %d", inbox, status)); snac_log(snac, xs_fmt("output sent to inbox %s %d", inbox, status));
if (!valid_status(status)) { if (!valid_status(status)) {
/* error sending; requeue? */ /* error sending; requeue? */
if (status == 404 || status == 410) if (status == 404 || status == 410)
/* explicit error: discard */ /* explicit error: discard */
snac_log(snac, xs_fmt("process_queue error %s %d", inbox, status)); snac_log(snac, xs_fmt("output error %s %d", inbox, status));
else else
if (retries > queue_retry_max) if (retries > queue_retry_max)
snac_log(snac, xs_fmt("process_queue giving up %s %d", inbox, status)); snac_log(snac, xs_fmt("output giving up %s %d", inbox, status));
else { else {
/* requeue */ /* requeue */
enqueue_output(snac, msg, inbox, retries + 1); enqueue_output(snac, msg, inbox, retries + 1);
snac_log(snac, xs_fmt("process_queue requeue %s #%d", inbox, retries + 1)); snac_log(snac, xs_fmt("output requeue %s #%d", inbox, retries + 1));
} }
} }
} }
@ -1155,14 +1155,16 @@ void process_user_queue_item(snac *snac, xs_dict *q_item)
if (!process_input_message(snac, msg, req)) { if (!process_input_message(snac, msg, req)) {
if (retries > queue_retry_max) if (retries > queue_retry_max)
snac_log(snac, xs_fmt("process_queue input giving up")); snac_log(snac, xs_fmt("input giving up"));
else { else {
/* reenqueue */ /* reenqueue */
enqueue_input(snac, msg, req, retries + 1); enqueue_input(snac, msg, req, retries + 1);
snac_log(snac, xs_fmt("process_queue input requeue #%d", retries + 1)); snac_log(snac, xs_fmt("input requeue #%d", retries + 1));
} }
} }
} }
else
snac_log(snac, xs_fmt("unexpected q_item type '%s'", type));
} }
@ -1245,6 +1247,8 @@ void process_queue_item(xs_dict *q_item)
srv_log(xs_dup("purge end")); srv_log(xs_dup("purge end"));
} }
else
srv_log(xs_fmt("unexpected q_item type '%s'", type));
} }