For async, send response message from go block

This commit is contained in:
Jim Clark
2023-05-02 13:06:29 -07:00
committed by James Carnegie
parent 3b689d3762
commit 68430613f1
2 changed files with 6 additions and 3 deletions

View File

@@ -69,6 +69,7 @@ func generate_sbom(message *babashka.Message, image string, username string, pas
break
}
}
babashka.WriteInvokeResponse(message, "done");
return nil
}()
@@ -192,7 +193,7 @@ func ProcessMessage(message *babashka.Message) (any, error) {
babashka.WriteErrorResponse(message, err)
}
}
return "done", nil
return "running", nil
case "docker.tools/generate-hashes":
args := []string{}

View File

@@ -28,7 +28,9 @@ func main() {
babashka.WriteDescribeResponse(describeres)
continue
}
// TODO don't write done responses when callback is running
if res != "running" {
babashka.WriteInvokeResponse(message, res)
}
}
}