mirror of
https://github.com/fosrl/olm.git
synced 2026-02-08 05:56:41 +00:00
13
main.go
13
main.go
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user