longer wait
This commit is contained in:
@@ -205,11 +205,11 @@ func NewSyncedPool(local *GrainLocalPool, hostname string, discovery Discovery)
|
|||||||
}
|
}
|
||||||
known := pool.IsKnown(chng.Host)
|
known := pool.IsKnown(chng.Host)
|
||||||
if chng.Type != watch.Deleted && !known {
|
if chng.Type != watch.Deleted && !known {
|
||||||
go func(h string) {
|
|
||||||
log.Printf("Discovered host %s, waiting for startup", h)
|
log.Printf("Discovered host %s, waiting for startup", h)
|
||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
pool.AddRemote(h)
|
pool.AddRemote(chng.Host)
|
||||||
}(chng.Host)
|
|
||||||
} else if chng.Type == watch.Deleted && known {
|
} else if chng.Type == watch.Deleted && known {
|
||||||
log.Printf("Host removed %s, removing from index", chng.Host)
|
log.Printf("Host removed %s, removing from index", chng.Host)
|
||||||
for _, r := range pool.remotes {
|
for _, r := range pool.remotes {
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ func WaitForFrame(conn net.Conn, resultChan chan<- FrameWithPayload) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type GenericListener struct {
|
type GenericListener struct {
|
||||||
Closed bool
|
StopListener bool
|
||||||
handlers map[FrameType]func(*FrameWithPayload, chan<- FrameWithPayload) error
|
handlers map[FrameType]func(*FrameWithPayload, chan<- FrameWithPayload) error
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ func (c *Connection) Listen() (*GenericListener, error) {
|
|||||||
handlers: make(map[FrameType]func(*FrameWithPayload, chan<- FrameWithPayload) error),
|
handlers: make(map[FrameType]func(*FrameWithPayload, chan<- FrameWithPayload) error),
|
||||||
}
|
}
|
||||||
go func() {
|
go func() {
|
||||||
for !ret.Closed {
|
for !ret.StopListener {
|
||||||
connection, err := l.Accept()
|
connection, err := l.Accept()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Error accepting connection: %v\n", err)
|
log.Fatalf("Error accepting connection: %v\n", err)
|
||||||
@@ -159,7 +159,7 @@ func (c *Connection) Listen() (*GenericListener, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
MaxCallDuration = 500 * time.Millisecond
|
MaxCallDuration = 1500 * time.Millisecond
|
||||||
)
|
)
|
||||||
|
|
||||||
func (l *GenericListener) HandleConnection(conn net.Conn) {
|
func (l *GenericListener) HandleConnection(conn net.Conn) {
|
||||||
|
|||||||
Reference in New Issue
Block a user