mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-24 23:35:24 +02:00
fix: add error handling to dokploy restart notifications
This commit is contained in:
@@ -19,27 +19,28 @@ import {
|
|||||||
} from "./utils";
|
} from "./utils";
|
||||||
|
|
||||||
export const sendDokployRestartNotifications = async () => {
|
export const sendDokployRestartNotifications = async () => {
|
||||||
const date = new Date();
|
try {
|
||||||
const unixDate = ~~(Number(date) / 1000);
|
const date = new Date();
|
||||||
const notificationList = await db.query.notifications.findMany({
|
const unixDate = ~~(Number(date) / 1000);
|
||||||
where: eq(notifications.dokployRestart, true),
|
const notificationList = await db.query.notifications.findMany({
|
||||||
with: {
|
where: eq(notifications.dokployRestart, true),
|
||||||
email: true,
|
with: {
|
||||||
discord: true,
|
email: true,
|
||||||
telegram: true,
|
discord: true,
|
||||||
slack: true,
|
telegram: true,
|
||||||
resend: true,
|
slack: true,
|
||||||
gotify: true,
|
resend: true,
|
||||||
ntfy: true,
|
gotify: true,
|
||||||
custom: true,
|
ntfy: true,
|
||||||
lark: true,
|
custom: true,
|
||||||
pushover: true,
|
lark: true,
|
||||||
teams: true,
|
pushover: true,
|
||||||
},
|
teams: true,
|
||||||
});
|
},
|
||||||
|
});
|
||||||
|
|
||||||
for (const notification of notificationList) {
|
for (const notification of notificationList) {
|
||||||
const {
|
const {
|
||||||
email,
|
email,
|
||||||
resend,
|
resend,
|
||||||
discord,
|
discord,
|
||||||
@@ -267,5 +268,8 @@ export const sendDokployRestartNotifications = async () => {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("[Dokploy] Restart notifications failed:", error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user