INNER CODE UNIT · Go

main

deviceinsight/kafkactl · main.go:29

func main() {
	ctx, cancel := signal.NotifyContext(context.Background(),
		syscall.SIGTERM, syscall.SIGINT)
	defer cancel()

	if err := runWithShutdownTimeout(ctx, 30*time.Second); err != nil {
		if errors.Is(err, context.Canceled) {
			os.Exit(0)
		}
		if errors.Is(err, context.DeadlineExceeded) {
			output.Warnf("Shutdown timeout exceeded, forced exit")
			os.Exit(1)
		}
		output.Warnf("%v", err)
		os.Exit(1)
	}
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…