Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
gatewayd queues javascript api spec
var gatewayd = require('gatewayd');
// process records in the postgres queue table one at a time forever, composed of records in:
// select * from external_transactions where status='queued' and deposit='false' limit 1;;
function job(withdrawal, next) {
// do something with the withdrawal, like sending to Dogecoind
.then(function() {
// update the withdrawal status to remove from the queue
withdrawal.udpateAttributes({ status: 'cleared' })
// ******** TESTS *******
assert.strictEqual(gatewayd.queues.withdrawals.modelName, 'externalTransactions');
assert.strictEqual(gatewayd.queues.withdrawals.predicate, { status: queued, deposit: false });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.