Drop invalid jobs
ci/woodpecker/tag/ociImageTag Pipeline was successful Details

This commit is contained in:
Natty 2024-01-08 03:32:05 +01:00
parent 21a6d3b979
commit da04190d47
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
2 changed files with 4 additions and 12 deletions

View File

@ -28,7 +28,6 @@ import {
webhookDeliverQueue,
} from "./queues.js";
import type {ThinUser} from "./types.js";
import {URL} from "node:url";
function renderError(e: Error): any {
return {
@ -170,16 +169,9 @@ export function deliver(user: ThinUser, content: unknown, to: string | null) {
to,
};
try {
new URL(data.to);
} catch (e) {
deliverLogger.error(`Failed URL parse, incorrect data: ${JSON.stringify(data)}`);
return null;
}
return deliverQueue.add(data, {
attempts: config.deliverJobMaxAttempts || 12,
timeout: 1 * 60 * 1000, // 1min
timeout: 60 * 1000, // 1min
backoff: {
type: "apBackoff",
},

View File

@ -20,9 +20,9 @@ export default async (job: Bull.Job<DeliverJobData>) => {
try {
host = new URL(job.data.to).host;
} catch (e) {
logger.error(`${e}`);
logger.error(`Failed URL parse: ${job}`);
return null;
logger.error(`Invalid URL: ${e}`);
await job.discard();
throw e;
}
const puny = toPuny(host);