Fix: Blockade des Mainthreads bzgl STRG+C behoben

This commit is contained in:
Marco Kittel 2025-07-19 18:33:26 +02:00
parent 6e67113a4a
commit 886550318f

View File

@ -10,6 +10,7 @@ import (
"os"
"os/signal"
"syscall"
"time"
"github.com/google/uuid"
"gittea.marcokittel.de/elio/eliotools/datawriter/internal/api"
@ -192,8 +193,12 @@ func main() {
return
})
log.Printf("Easy Peasy: Die Party startet auf Port %s\n", port)
log.Printf("Probiers mal damit: %s\n", curlhelp)
log.Fatal(http.ListenAndServe(port, nil))
go func() {
log.Printf("Easy Peasy: Die Party startet auf Port %s\n", port)
log.Printf("Probiers mal damit: %s\n", curlhelp)
log.Fatal(http.ListenAndServe(port, nil))
}()
<-ctx.Done()
log.Println("Beende Server in drei Sekunden...")
time.Sleep(time.Second * 3)
}