mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Refactor schedule run handling in ShowSchedules component
- Simplified the schedule run logic by directly displaying a success toast upon execution. - Removed redundant error handling for schedule runs, streamlining the code for better readability and maintainability.
This commit is contained in:
parent
b84b4549a0
commit
b9ac25ef42
@ -162,20 +162,16 @@ export const ShowSchedules = ({ id, scheduleType = "application" }: Props) => {
|
||||
size="icon"
|
||||
isLoading={isLoading}
|
||||
onClick={async () => {
|
||||
toast.success("Schedule run successfully");
|
||||
|
||||
await runManually({
|
||||
scheduleId: schedule.scheduleId,
|
||||
})
|
||||
.then(async () => {
|
||||
toast.success("Schedule run successfully");
|
||||
|
||||
await new Promise((resolve) =>
|
||||
setTimeout(resolve, 1500),
|
||||
);
|
||||
refetchSchedules();
|
||||
})
|
||||
.catch(() => {
|
||||
toast.error("Error running schedule:");
|
||||
});
|
||||
}).then(async () => {
|
||||
await new Promise((resolve) =>
|
||||
setTimeout(resolve, 1500),
|
||||
);
|
||||
refetchSchedules();
|
||||
});
|
||||
}}
|
||||
>
|
||||
<Play className="size-4 transition-colors" />
|
||||
|
Loading…
Reference in New Issue
Block a user