From f1f84f9a9a7211f99f2e9acae72c820f4202bd99 Mon Sep 17 00:00:00 2001 From: Namekuji Date: Thu, 13 Jul 2023 18:19:08 -0400 Subject: [PATCH] refactor: use copy_limit if greater than 0 --- .../migration/src/m20230709_000510_move_antenna_to_cache.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend/native-utils/migration/src/m20230709_000510_move_antenna_to_cache.rs b/packages/backend/native-utils/migration/src/m20230709_000510_move_antenna_to_cache.rs index a514e9b8e3..83bd0448ab 100644 --- a/packages/backend/native-utils/migration/src/m20230709_000510_move_antenna_to_cache.rs +++ b/packages/backend/native-utils/migration/src/m20230709_000510_move_antenna_to_cache.rs @@ -36,10 +36,10 @@ impl MigrationTrait for Migration { .await? .unwrap() .try_get_by_index::(0)?; - let copy_limit = if copy_limit == 0 { - total_num - } else { + let copy_limit = if copy_limit > 0 { copy_limit + } else { + total_num }; println!( "Copying {} out of {} entries in antenna_note.",