Convenience to wait for a newly-constructed client to connect.
(client)
| 1300 | |
| 1301 | |
| 1302 | async def connected(client): |
| 1303 | """Convenience to wait for a newly-constructed client to connect.""" |
| 1304 | with warnings.catch_warnings(): |
| 1305 | # Ignore warning that ping is always routed to primary even |
| 1306 | # if client's read preference isn't PRIMARY. |
| 1307 | warnings.simplefilter("ignore", UserWarning) |
| 1308 | await client.admin.command("ping") # Force connection. |
| 1309 | |
| 1310 | return client |
| 1311 | |
| 1312 | |
| 1313 | async def drop_collections(db: AsyncDatabase): |