1
0
Fork 0
mirror of https://github.com/zhaofengli/attic.git synced 2024-12-14 11:57:30 +00:00

Choose a more sensible limit for MySQL, suggested by @baloo

This commit is contained in:
Parnell Springmeyer 2024-02-28 14:06:31 -08:00
parent 2705d1d90b
commit d3ffcf885c
No known key found for this signature in database

View file

@ -159,8 +159,8 @@ async fn run_reap_orphan_chunks(state: &State) -> Result<()> {
let storage = state.storage().await?;
let orphan_chunk_limit = match db.get_database_backend() {
// Default value of --max-allowed-packet https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_max_allowed_packet
sea_orm::DatabaseBackend::MySql => 67108864,
// Arbitrarily chosen sensible value since there's no good default to choose from for MySQL
sea_orm::DatabaseBackend::MySql => 1000,
// Panic limit set by sqlx for postgresql: https://github.com/launchbadge/sqlx/issues/671#issuecomment-687043510
sea_orm::DatabaseBackend::Postgres => u64::from(u16::MAX),
// Default statement limit imposed by sqlite: https://www.sqlite.org/limits.html#max_variable_number