Skip to content

Commit

Permalink
cleanup unused code and broken pidfile gen
Browse files Browse the repository at this point in the history
  • Loading branch information
debugloop committed Nov 8, 2018
1 parent 4356a0f commit 68ccdfc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 38 deletions.
15 changes: 3 additions & 12 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ func main() {

flag.Parse()
util.InitLogger(*logFile)
util.WritePid(*pidFile)

// catch termination signal
signals := make(chan os.Signal, 1)
signal.Notify(signals, os.Interrupt, syscall.SIGTERM, syscall.SIGINT)
signal.Notify(signals)
signal.Notify(signals, syscall.SIGTERM, syscall.SIGINT)
go func() {
<-signals
shutdown(0)
log.Println("Received exit signal, kthxbye.")
os.Exit(0)
}()

// Enable Prometheus Export
Expand All @@ -56,11 +55,3 @@ func main() {
defer kafkaConn.Close()
runKafkaListener()
}

func shutdown(exitcode int) {
kafkaConn.Close()
os.Remove("./consumer_dashboard.pid")
log.Println("Received exit signal, kthxbye.")
// return exit code
os.Exit(exitcode)
}
3 changes: 1 addition & 2 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import "flag"

var (
// common options
logFile = flag.String("log", "", "Location of the log file.")
pidFile = flag.String("pid", "", "Location of the pid file.")
logFile = flag.String("log", "./consumer_dashboard.log", "Location of the log file.")

// Kafka options
kafkaConsumerGroup = flag.String("kafka.consumer_group", "dashboard", "Kafka Consumer Group")
Expand Down
24 changes: 0 additions & 24 deletions util/pid.go

This file was deleted.

0 comments on commit 68ccdfc

Please sign in to comment.