Explorar el Código

Merge pull request #15916 from jeclrsg/hpcc-27327-delete-unknown-workunit

HPCC-27327 EclWatch deleting workunits in unknown state

Reviewed-By: Gordon Smith <gordon.smith@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman hace 3 años
padre
commit
b7d0bea3be
Se han modificado 1 ficheros con 7 adiciones y 2 borrados
  1. 7 2
      esp/src/src-react/components/Workunits.tsx

+ 7 - 2
esp/src/src-react/components/Workunits.tsx

@@ -157,8 +157,13 @@ export const Workunits: React.FunctionComponent<WorkunitsProps> = ({
         title: nlsHPCC.Delete,
         message: nlsHPCC.DeleteSelectedWorkunits,
         items: selection.map(s => s.Wuid),
-        onSubmit: React.useCallback(() => {
-            WsWorkunits.WUAction(selection, "Delete").then(() => refreshTable(true));
+        onSubmit: React.useCallback(async () => {
+            const unknownWUs = selection.filter(wu => wu.State === "unknown");
+            if (unknownWUs.length) {
+                await WsWorkunits.WUAction(unknownWUs, "SetToFailed");
+            }
+            await WsWorkunits.WUAction(selection, "Delete");
+            refreshTable(true);
         }, [refreshTable, selection])
     });