aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/request.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/request.js')
-rw-r--r--server/models/request.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/models/request.js b/server/models/request.js
index 882f747b7..70aa32610 100644
--- a/server/models/request.js
+++ b/server/models/request.js
@@ -79,9 +79,11 @@ function deactivate () {
79 timer = null 79 timer = null
80} 80}
81 81
82function flush () { 82function flush (callback) {
83 removeAll.call(this, function (err) { 83 removeAll.call(this, function (err) {
84 if (err) logger.error('Cannot flush the requests.', { error: err }) 84 if (err) logger.error('Cannot flush the requests.', { error: err })
85
86 return callback(err)
85 }) 87 })
86} 88}
87 89
@@ -298,7 +300,7 @@ function listWithLimitAndRandom (limit, callback) {
298 300
299function removeAll (callback) { 301function removeAll (callback) {
300 // Delete all requests 302 // Delete all requests
301 this.destroy({ truncate: true }).asCallback(callback) 303 this.truncate({ cascade: true }).asCallback(callback)
302} 304}
303 305
304function removeWithEmptyTo (callback) { 306function removeWithEmptyTo (callback) {