mirror of https://github.com/rwf2/Rocket.git
327b1ad064
Prior to this commit, connections from 'sync_db_pools' assumed that they were being dropped in an async context. This is overwhelmingly the common case as connections are typically dropped immediately after request processing. Nothing requires this, however, so holding a connection beyond the scope of the async context was possible (i.e. by storing a connection in managed state). Given the connection's `Drop` impl calls `spawn_blocking`, this resulted in a panic on drop. This commit resolves the issue by modifying `Drop` so that it calls `spawn_blocking` only when it is executing inside an async context. If not, the connection is dropped normally, without `spawn_blocking`. |
||
---|---|---|
.. | ||
db_pools | ||
dyn_templates | ||
sync_db_pools | ||
ws |