Do not stop to listen on tcp listeners on temporary errors
This commit is contained in:
parent
ef38810425
commit
0e6dce7093
2 changed files with 6 additions and 1 deletions
|
@ -135,6 +135,10 @@ func (e *TCPEntryPoint) startTCP(ctx context.Context) {
|
|||
conn, err := e.listener.Accept()
|
||||
if err != nil {
|
||||
logger.Error(err)
|
||||
if netErr, ok := err.(net.Error); ok && netErr.Temporary() {
|
||||
continue
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,8 @@ func (f FileOrContent) IsPath() bool {
|
|||
|
||||
func (f FileOrContent) Read() ([]byte, error) {
|
||||
var content []byte
|
||||
if _, err := os.Stat(f.String()); err == nil {
|
||||
if f.IsPath() {
|
||||
var err error
|
||||
content, err = ioutil.ReadFile(f.String())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in a new issue