Skip to content

Instantly share code, notes, and snippets.

@bahamas10
Created April 3, 2019 19:09
Show Gist options
  • Select an option

  • Save bahamas10/98533be4141da45c16bdddd3433b1bc3 to your computer and use it in GitHub Desktop.

Select an option

Save bahamas10/98533be4141da45c16bdddd3433b1bc3 to your computer and use it in GitHub Desktop.
var vasync = require('vasync');
var boray = require('boray');
var bunyan = require('bunyan');
var log = bunyan.createLogger({
name: 'dave',
level: 'debug',
});
var borayHost = '10.0.1.126';
var vnode = 4;
var owner = '14aafd84-a57f-11e8-8706-4fc23c74c5e7';
var name = 'test-bucket-list-43';
var todo = 10;
var concur = 5;
var client = new boray.Client({
log: log,
host: borayHost,
cueballOptions: {
resolvers: [],
defaultPort: 2030
}
});
setTimeout(function () {
var done = 0;
var q = vasync.queue(function (i, cb) {
client.getBucket(owner, name, vnode, function (err, b) {
if (err) {
throw err;
}
done++;
log.error('%d: %j', done, b);
if (done === todo) {
log.fatal('ALL DONE');
}
cb();
});
}, concur);
for (var i = 0; i < todo; i++) {
q.push(i);
}
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment