Rocket/contrib/sync_db_pools/lib
Sergio Benitez 327b1ad064 Allow sync drops for 'sync_db_pools' connections.
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`.
2024-08-18 20:03:01 -07:00
..
src Allow sync drops for 'sync_db_pools' connections. 2024-08-18 20:03:01 -07:00
tests Allow sync drops for 'sync_db_pools' connections. 2024-08-18 20:03:01 -07:00
Cargo.toml Allow sync drops for 'sync_db_pools' connections. 2024-08-18 20:03:01 -07:00
LICENSE-APACHE Symlink license files in all crate directories. 2024-04-06 20:46:07 -07:00
LICENSE-MIT Symlink license files in all crate directories. 2024-04-06 20:46:07 -07:00
build.rs Add pool retrieval to sync_db_pools. 2022-05-24 16:47:09 -07:00