Reconnect to LDAP backend after network issue, version bump to 1.0.2
This commit is contained in:
parent
8ac556ad8b
commit
0e73dac143
@ -26,7 +26,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -281,7 +281,7 @@ func searchLdap(searchReq *ldap.SearchRequest, attempt int) (*ldap.SearchResult,
|
|||||||
result, err := conLdap.Search(searchReq)
|
result, err := conLdap.Search(searchReq)
|
||||||
mutex.Unlock()
|
mutex.Unlock()
|
||||||
// Let's just manage connection errors here
|
// Let's just manage connection errors here
|
||||||
if err != nil && strings.HasSuffix(err.Error(), "ldap: connection closed") {
|
if (err != nil && (strings.HasSuffix(err.Error(), "ldap: connection closed")|| strings.HasSuffix(err.Error(), "ldap: conn is nil, expected net.Conn"))) {
|
||||||
logstream.Error("LDAP connection closed, retrying")
|
logstream.Error("LDAP connection closed, retrying")
|
||||||
mutex.Lock()
|
mutex.Lock()
|
||||||
// 16/01/2023: panic: runtime error: invalid memory address or nil pointer dereference
|
// 16/01/2023: panic: runtime error: invalid memory address or nil pointer dereference
|
||||||
@ -375,7 +375,7 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("MyNetTCPTable v.%s\n", version)
|
fmt.Printf("%s: MyNetTCPTable v.%s starting\n", time.Now().Format(time.RFC3339), version)
|
||||||
|
|
||||||
logstream = logrus.New()
|
logstream = logrus.New()
|
||||||
level, err := logrus.ParseLevel(*logLevel)
|
level, err := logrus.ParseLevel(*logLevel)
|
||||||
|
Loading…
Reference in New Issue
Block a user