Exemple #1
0
func buildHangUp(ctx *builder.Context) {
	signalChan := make(chan os.Signal)
	signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM)
	builder.Build(ctx)
	<-signalChan
	log15.Info("Close")
}
Exemple #2
0
func build(ctx *builder.Context, mustWatch bool) {
	// ctrl+C capture
	signalChan := make(chan os.Signal)
	signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM)

	builder.Build(ctx)

	if ctx.Cli().Bool("watch") || mustWatch {
		builder.Watch(ctx)
		<-signalChan
		log15.Info("Watch|Close")
	}
}