Live video on the AT Protocol
at eli/database-resync 50 lines 904 B view raw
1package main 2 3import ( 4 "context" 5 "errors" 6 "os" 7 "strconv" 8 9 "stream.place/streamplace/pkg/config" 10 "stream.place/streamplace/pkg/log" 11 12 "stream.place/streamplace/pkg/cmd" 13 // _ "github.com/go-gst/go-glib/glib" 14 // _ "github.com/go-gst/go-gst/gst" 15) 16 17//#cgo pkg-config: streamplacedeps-uninstalled 18import "C" 19 20var cleanExits = []error{ 21 cmd.ErrCaughtSignal, 22 context.DeadlineExceeded, 23} 24 25//export StreamplaceMain 26func StreamplaceMain() { 27 i, err := strconv.ParseInt(BuildTime, 10, 64) 28 if err != nil { 29 panic(err) 30 } 31 err = cmd.Start(&config.BuildFlags{ 32 Version: Version, 33 BuildTime: i, 34 UUID: UUID, 35 }) 36 if err != nil { 37 for _, e := range cleanExits { 38 if errors.Is(err, e) { 39 log.Log(context.Background(), "exited cleanly", "error", err) 40 os.Exit(0) 41 } 42 } 43 log.Log(context.Background(), "exited uncleanly", "error", err) 44 os.Exit(1) 45 } 46} 47 48func main() { 49 StreamplaceMain() 50}