Created
April 9, 2015 02:24
-
-
Save c4pt0r/7f6cf188804fc246bc7c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sort.Strings(proxyIds) | |
// check every 500ms | |
for times < 60 { | |
if times >= 6 && (times*500)%1000 == 0 { | |
log.Warning("abnormal waiting time for receivers", actionZkPath) | |
} | |
nodes, _, err := zkConn.Children(actionZkPath) | |
if err != nil { | |
return errors.Trace(err) | |
} | |
var confirmIds []string | |
for _, node := range nodes { | |
id := path.Base(node) | |
confirmIds = append(confirmIds, id) | |
} | |
if len(confirmIds) != 0 { | |
sort.Strings(confirmIds) | |
if utils.Strings(proxyIds).Eq(confirmIds) { | |
return nil | |
} | |
offlineProxyIds = proxyIds[len(confirmIds)-1:] | |
} | |
times += 1 | |
time.Sleep(500 * time.Millisecond) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment