Log invalid deliveries
ci/woodpecker/tag/ociImageTag Pipeline is running
Details
ci/woodpecker/tag/ociImageTag Pipeline is running
Details
This commit is contained in:
parent
e7ff3a81bb
commit
3fe46dc6f9
|
@ -18,16 +18,17 @@ import { endedPollNotification } from "./processors/ended-poll-notification.js";
|
|||
import {queueLogger} from "./logger.js";
|
||||
import {getJobInfo} from "./get-job-info.js";
|
||||
import {
|
||||
systemQueue,
|
||||
backgroundQueue,
|
||||
dbQueue,
|
||||
deliverQueue,
|
||||
endedPollNotificationQueue,
|
||||
inboxQueue,
|
||||
objectStorageQueue,
|
||||
endedPollNotificationQueue,
|
||||
systemQueue,
|
||||
webhookDeliverQueue,
|
||||
backgroundQueue,
|
||||
} from "./queues.js";
|
||||
import type {ThinUser} from "./types.js";
|
||||
import {URL} from "node:url";
|
||||
|
||||
function renderError(e: Error): any {
|
||||
return {
|
||||
|
@ -169,6 +170,13 @@ 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
|
||||
|
|
Loading…
Reference in New Issue