Skip to content

Instantly share code, notes, and snippets.

@mattcollier
Created April 25, 2015 12:38
Show Gist options
  • Save mattcollier/9117c7e527508b844588 to your computer and use it in GitHub Desktop.
Save mattcollier/9117c7e527508b844588 to your computer and use it in GitHub Desktop.
variablescope
var bootstrapProgress = 0;
controlClient.on('data', function(data){
data = data.toString();
if (torControlMessageHandler) torControlMessageHandler(data.toString());
if (data.search(/250-status\/bootstrap-phase/) >= 0) {
var bootstrapPhase = extractBootstrap2(data);
if (bootstrapPhase.progress < 100) {
setTimeout(bsStatus, 250);
}
console.log('new:', bootstrapPhase.progress, 'old:', bootstrapProgress);
if(bootstrapPhase.progress > bootstrapProgress) {
self.emit('bootstrap', bootstrapPhase);
}
var bootstrapProgress = bootstrapPhase.progress;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment