Check for closed channel

This commit is contained in:
Jim Clark
2023-05-02 13:54:49 -07:00
committed by James Carnegie
parent 68430613f1
commit 11a7d10ea7

View File

@@ -58,13 +58,12 @@ func generate_sbom(message *babashka.Message, image string, username string, pas
go func() error {
for {
tx := <-tx_channel
if tx != "" {
tx, ok := <-tx_channel
if (ok && tx != "") {
err := babashka.WriteNotDoneInvokeResponse(message, tx)
if err != nil {
babashka.WriteErrorResponse(message, err)
}
} else {
break
}