Skip to content

Commit

Permalink
Don't run tcp listener if tcp.listen not configured
Browse files Browse the repository at this point in the history
  • Loading branch information
wlcx authored and russss committed Jan 16, 2024
1 parent a12b6ea commit 60526f6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,13 @@ func main() {
signal.Notify(irccat.signals, os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
go irccat.signalHandler()

irccat.tcp, err = tcplistener.New()
if err != nil {
log.Criticalf("Error starting TCP listener: %s", err)
return
if viper.IsSet("tcp.listen") {
irccat.tcp, err = tcplistener.New()
if err != nil {
log.Criticalf("Error starting TCP listener: %s", err)
return
}
irccat.tcp.Run(irccat.irc)
}

err = irccat.connectIRC(*debug)
Expand All @@ -87,7 +90,6 @@ func main() {
httplistener.New(irccat.irc)
}

irccat.tcp.Run(irccat.irc)
irccat.irc.Loop()
}

Expand Down

0 comments on commit 60526f6

Please sign in to comment.