Drop invalid jobs
ci/woodpecker/tag/ociImageTag Pipeline was successful
Details
ci/woodpecker/tag/ociImageTag Pipeline was successful
Details
This commit is contained in:
parent
21a6d3b979
commit
da04190d47
|
@ -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",
|
||||
},
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue