timer = null
}
-function flush () {
+function flush (callback) {
removeAll.call(this, function (err) {
if (err) logger.error('Cannot flush the requests.', { error: err })
+
+ return callback(err)
})
}
function removeAll (callback) {
// Delete all requests
- this.destroy({ truncate: true }).asCallback(callback)
+ this.truncate({ cascade: true }).asCallback(callback)
}
function removeWithEmptyTo (callback) {