|
|
@@ -39,9 +39,11 @@ export default function TaskProcessingCard() {
|
|
|
const startTaskProcessingMutation = useMutation({
|
|
|
mutationFn: () => post("/tasks/start-processing"),
|
|
|
onSuccess: async () => {
|
|
|
- toast.success("Task processing started");
|
|
|
+ // Small delay to let backend update state
|
|
|
+ await new Promise((resolve) => setTimeout(resolve, 200));
|
|
|
await refetchTaskProcessingStatus();
|
|
|
queryClient.invalidateQueries({ queryKey: ["tasks", "queue", "status"] });
|
|
|
+ toast.success("Task processing started");
|
|
|
},
|
|
|
onError: () => {
|
|
|
toast.error("Failed to start task processing");
|
|
|
@@ -51,9 +53,11 @@ export default function TaskProcessingCard() {
|
|
|
const stopTaskProcessingMutation = useMutation({
|
|
|
mutationFn: () => post("/tasks/stop-processing"),
|
|
|
onSuccess: async () => {
|
|
|
- toast.success("Task processing stopped");
|
|
|
+ // Small delay to let backend update state
|
|
|
+ await new Promise((resolve) => setTimeout(resolve, 200));
|
|
|
await refetchTaskProcessingStatus();
|
|
|
queryClient.invalidateQueries({ queryKey: ["tasks", "queue", "status"] });
|
|
|
+ toast.success("Task processing stopped");
|
|
|
},
|
|
|
onError: () => {
|
|
|
toast.error("Failed to stop task processing");
|