Fix: Added try/catch to CRON
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "plunk",
|
"name": "plunk",
|
||||||
"version": "1.0.6",
|
"version": "1.0.7",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "agpl-3.0",
|
"license": "agpl-3.0",
|
||||||
"workspaces": {
|
"workspaces": {
|
||||||
|
|||||||
@@ -4,12 +4,22 @@ import { API_URI } from "./constants";
|
|||||||
|
|
||||||
export const task = cron.schedule("* * * * *", () => {
|
export const task = cron.schedule("* * * * *", () => {
|
||||||
signale.info("Running scheduled tasks");
|
signale.info("Running scheduled tasks");
|
||||||
void fetch(`${API_URI}/tasks`, {
|
try {
|
||||||
method: "POST",
|
void fetch(`${API_URI}/tasks`, {
|
||||||
});
|
method: "POST",
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
signale.error("Failed to run scheduled tasks. Please check the error below");
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
|
||||||
signale.info("Updating verified identities");
|
signale.info("Updating verified identities");
|
||||||
void fetch(`${API_URI}/identities/update`, {
|
try {
|
||||||
method: "POST",
|
void fetch(`${API_URI}/identities/update`, {
|
||||||
});
|
method: "POST",
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
signale.error("Failed to update verified identities. Please check the error below");
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user