Skip to content

Commit

Permalink
fix: remove unused async local storage middleware (#1817)
Browse files Browse the repository at this point in the history
This middleware was made obsolete by e98b8d1.
  • Loading branch information
andrew0 committed May 30, 2024
1 parent 5573b96 commit 5bc0b46
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
5 changes: 0 additions & 5 deletions __tests__/application/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,4 @@ describe('app', () => {
assert.deepStrictEqual(Koa.HttpError, CreateError.HttpError)
assert.throws(() => { throw new CreateError(500, 'test error') }, Koa.HttpError)
})

it('should export createAsyncCtxStorageMiddleware function', () => {
const app = new Koa()
assert.strictEqual(typeof app.createAsyncCtxStorageMiddleware, 'function')
})
})
9 changes: 0 additions & 9 deletions lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,6 @@ module.exports = class Application extends Emitter {
static get default () {
return Application
}

createAsyncCtxStorageMiddleware () {
const app = this
return async function asyncCtxStorage (ctx, next) {
await app.ctxStorage.run(ctx, async () => {
return await next()
})
}
}
}

/**
Expand Down

0 comments on commit 5bc0b46

Please sign in to comment.