Skip to content

Commit

Permalink
b
Browse files Browse the repository at this point in the history
  • Loading branch information
root27 committed Jun 5, 2024
1 parent 75d1661 commit 976703d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import (
"fmt"
"github.com/fatih/color"
"github.com/root27/slacknotifyMQ/controllers"
"os"
"os/signal"
"syscall"
)

var (
Expand Down Expand Up @@ -65,6 +68,16 @@ func main() {
SlackChannel: slackChannel,
}

stopChan := make(chan os.Signal, 1)

signal.Notify(stopChan, os.Interrupt, syscall.SIGTERM)

go func() {
<-stopChan
fmt.Println(color.RedString("Notifier Stopped"))
os.Exit(0)
}()

s.HandleRabbit()

}

0 comments on commit 976703d

Please sign in to comment.