var seenRequest = function(id, url, date, token, callback) { var ms = Date.parse(date), props = { endpoint: url, id: id, token: token, timestamp: ms }, key = DialbackRequest.toKey(props); Step( function() { DialbackRequest.get(key, this); }, function(err, req) { if (err && (err.name == "NoSuchThingError")) { callback(null, false); } else if (err) { callback(err, null); } else { callback(null, true); } } ); };
function() { DialbackRequest.get(key, this); },
function() { DialbackRequest.create(props, this); },