diff --git a/index.js b/index.js index 69f13f1..cfaa3ef 100644 --- a/index.js +++ b/index.js @@ -28,13 +28,15 @@ module.exports = class { debug('Server started'); return async (req, res) => { const context = { req, res, app: this }; + const promises = [...this.promises]; try { - await promisify(context, [...this.promises]); + await promisify(context, this.promises); } catch (error) { if (error && this.error) { this.error(error, context); } } + this.promises = promises; }; } diff --git a/package.json b/package.json index 3a90285..467b328 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yeps", - "version": "0.0.10", + "version": "0.0.11", "description": "Yet Another Event Promised Server", "main": "index.js", "scripts": {