mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Enhance ShowSchedules component with improved user feedback and schedule execution
- Updated the ShowSchedules component to include a delay before refetching schedules after a successful manual run, enhancing user experience by providing a brief confirmation period. - Removed unnecessary console logging in the updateSchedule function to streamline the code and improve maintainability. - Modified the scheduleJob utility to accept scheduleId as the first parameter, improving clarity and consistency in job scheduling.
This commit is contained in:
@@ -165,8 +165,12 @@ export const ShowSchedules = ({ id, scheduleType = "application" }: Props) => {
|
|||||||
await runManually({
|
await runManually({
|
||||||
scheduleId: schedule.scheduleId,
|
scheduleId: schedule.scheduleId,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(async () => {
|
||||||
toast.success("Schedule run successfully");
|
toast.success("Schedule run successfully");
|
||||||
|
|
||||||
|
await new Promise((resolve) =>
|
||||||
|
setTimeout(resolve, 1500),
|
||||||
|
);
|
||||||
refetchSchedules();
|
refetchSchedules();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
|||||||
@@ -101,8 +101,6 @@ export const updateSchedule = async (
|
|||||||
await handleScript(updatedSchedule);
|
await handleScript(updatedSchedule);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("updatedSchedule", updatedSchedule);
|
|
||||||
|
|
||||||
if (IS_CLOUD) {
|
if (IS_CLOUD) {
|
||||||
// scheduleJob(updatedSchedule);
|
// scheduleJob(updatedSchedule);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import path from "node:path";
|
|||||||
export const scheduleJob = (schedule: Schedule) => {
|
export const scheduleJob = (schedule: Schedule) => {
|
||||||
const { cronExpression, scheduleId } = schedule;
|
const { cronExpression, scheduleId } = schedule;
|
||||||
|
|
||||||
scheduleJobNode(cronExpression, async () => {
|
scheduleJobNode(scheduleId, cronExpression, async () => {
|
||||||
await runCommand(scheduleId);
|
await runCommand(scheduleId);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user