Skip to content

Commit ce89925

Browse files
committed
RESUME_AFTER_DEPENDENCY_WITH_ACK: any successful responses = success
Also added a backoff if the catch is hit, and log the error out
1 parent 33c108b commit ce89925

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

apps/webapp/app/v3/marqs/sharedQueueConsumer.server.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -756,11 +756,11 @@ export class SharedQueueConsumer {
756756
return;
757757
}
758758

759-
const failed = responses.filter((response) => !response.success);
760-
if (failed.length > 0) {
761-
logger.error("RESUME_AFTER_DEPENDENCY_WITH_ACK failed", {
759+
const hasSuccess = responses.some((response) => response.success);
760+
if (!hasSuccess) {
761+
logger.warn("RESUME_AFTER_DEPENDENCY_WITH_ACK failed", {
762762
resumeMessage,
763-
failed,
763+
responses,
764764
message,
765765
});
766766
await this.#nackAndDoMoreWork(message.messageId, this._options.nextTickInterval, 5_000);
@@ -775,7 +775,12 @@ export class SharedQueueConsumer {
775775

776776
this._endSpanInNextIteration = true;
777777

778-
await this.#nackAndDoMoreWork(message.messageId);
778+
logger.error("RESUME_AFTER_DEPENDENCY_WITH_ACK threw, nacking with delay", {
779+
message,
780+
error: e,
781+
});
782+
783+
await this.#nackAndDoMoreWork(message.messageId, this._options.nextTickInterval, 5_000);
779784
return;
780785
}
781786

0 commit comments

Comments
 (0)