Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove unused async local storage middleware #1817

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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