Hi.
After adding .enableExperimentalFeature("StrictConcurrency")
to my Vapor executable target, I am getting converting non-sendable function value to '@Sendable (Request) async throws -> Response' may introduce data races
warning on all my request handlers inside my RouteCollection
controllers.
Here is an example of such a controller:
struct AuthController: RouteCollection {
func boot(routes: RoutesBuilder) throws {
let auth = routes.grouped("auth")
auth.post("login", use: login(req:))
}
func login(req: Request) async throws -> Response {
// some code goes here
}
}
Should I ignore converting non-sendable function value to '@Sendable (Request) async throws -> Response
warning, or should I manually add @Sendable
to all handlers? Is there a better way?
Thank you.