Skip to content

Instantly share code, notes, and snippets.

@mkleehammer
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkleehammer/050c8e9a782edbf4c7e0 to your computer and use it in GitHub Desktop.
Save mkleehammer/050c8e9a782edbf4c7e0 to your computer and use it in GitHub Desktop.
rethinkdbdash hang?
#!/usr/bin/env node --harmony
var co = require('co');
var r = require('rethinkdbdash')();
co(function *() {
'use strict';
try {
var TABLE = 'mktest';
var result;
var tables = yield r.tableList().run();
console.log('tables:', tables);
if (tables.indexOf(TABLE) !== -1) {
console.log('drop', TABLE);
result = yield r.tableDrop(TABLE).run();
console.log('', result);
}
console.log('create');
result = yield r.tableCreate(TABLE).run();
console.log('', result);
console.log('draining');
yield r.getPool().drain();
console.log('end');
} catch (error) {
console.log('error:', error);
process.exit(1);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment