Fix windows build

Former-commit-id: 6af69cdcd6
This commit is contained in:
Owen
2025-11-08 20:39:36 -08:00
parent 079843602c
commit 7fc09f8ed1
3 changed files with 15 additions and 7 deletions

13
main.go
View File

@@ -153,6 +153,15 @@ func main() {
}
}
// Create a context that will be cancelled on interrupt signals
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
// Run in console mode
runOlmMainWithArgs(ctx, os.Args[1:])
}
func runOlmMainWithArgs(ctx context.Context, args []string) {
// Setup Windows event logging if on Windows
if runtime.GOOS != "windows" {
setupWindowsEventLog()
@@ -212,9 +221,5 @@ func main() {
// DoNotCreateNewClient: config.DoNotCreateNewClient,
}
// Create a context that will be cancelled on interrupt signals
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
olm.Run(ctx, olmConfig)
}