pigeon
pigeon copied to clipboard
Reference cycle issues
Seeing some memory leaks on most routes, most likely due to db requests via query(on: request) which is apparently not best practice.
- [ ] Implement thread-safe controllers
- [ ] Switch to using
withPooledConnection(to: .psql)for db queries, like
func routes(_ container: Container) throws -> EngineRouter {
let router = EngineRouter.default()
router.get("test") { req in
return container.withPooledConnection(to: .psql) { ... }
}
return router
}