Skip to content

Commit

Permalink
nsqd/nsqlookupd: exit when tcp server accept error
Browse files Browse the repository at this point in the history
  • Loading branch information
mdh67899 committed Feb 26, 2019
1 parent fd1cde1 commit 29b1580
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion apps/nsqd/nsqd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"crypto/tls"
"errors"
"flag"
"fmt"
"log"
Expand All @@ -14,7 +15,7 @@ import (
"time"

"github.com/BurntSushi/toml"
"github.com/judwhite/go-svc/svc"
"github.com/mdh67899/go-svc/svc"
"github.com/mreiferson/go-options"
"github.com/nsqio/nsq/internal/app"
"github.com/nsqio/nsq/internal/version"
Expand Down Expand Up @@ -246,3 +247,10 @@ func (p *program) Stop() error {
}
return nil
}

func (p *program) GetExitChan() (chan interface{}, error) {
if p.nsqd != nil {
return p.nsqd.GetFatalChan(), nil
}
return nil, errors.New("nsqd is not initialized yet.")
}

0 comments on commit 29b1580

Please sign in to comment.