stabilized zmq loop
This commit is contained in:
parent
1cfe9e83bb
commit
53f78abaf3
@ -4,6 +4,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
"time"
|
||||||
|
|
||||||
"git.paulbsd.com/paulbsd/ipbl/src/config"
|
"git.paulbsd.com/paulbsd/ipbl/src/config"
|
||||||
"git.paulbsd.com/paulbsd/ipbl/src/models"
|
"git.paulbsd.com/paulbsd/ipbl/src/models"
|
||||||
@ -49,6 +50,7 @@ func Handle(cfg *config.Config, reqsock *goczmq.Sock, pubsock *goczmq.Sock, chan
|
|||||||
err = json.Unmarshal(val, &apievent)
|
err = json.Unmarshal(val, &apievent)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("unable to parse ip address", err)
|
log.Println("unable to parse ip address", err)
|
||||||
|
time.Sleep(time.Second)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if apievent.IPData.IP != "" && apievent.IPData.IP == lastip {
|
if apievent.IPData.IP != "" && apievent.IPData.IP == lastip {
|
||||||
|
Loading…
Reference in New Issue
Block a user