@@ -137,7 +137,7 @@ impl TablePair {
137137 } )
138138 } ) ?;
139139 let rows = rows. unwrap_or ( 0 ) ;
140- tracker. copy_final_batch ( conn, & self . src , rows, & batcher) ?;
140+ tracker. copy_batch ( conn, & self . src , rows as i64 , & batcher) ?;
141141 cancel. check_cancel ( ) ?;
142142
143143 reporter. prune_batch (
@@ -196,7 +196,7 @@ impl TablePair {
196196 } ) ?;
197197 let rows = rows. unwrap_or ( 0 ) ;
198198
199- tracker. copy_nonfinal_batch ( conn, & self . src , rows as i64 , & batcher) ?;
199+ tracker. copy_batch ( conn, & self . src , rows as i64 , & batcher) ?;
200200
201201 reporter. prune_batch (
202202 self . src . name . as_str ( ) ,
@@ -458,7 +458,7 @@ impl Layout {
458458 . execute ( conn) . map_err ( StoreError :: from) } ) ?;
459459 let rows = rows. unwrap_or ( 0 ) ;
460460
461- tracker. delete_batch ( conn, table, rows, & batcher) ?;
461+ tracker. copy_batch ( conn, table, - ( rows as i64 ) , & batcher) ?;
462462
463463 reporter. prune_batch (
464464 table. name . as_str ( ) ,
@@ -682,7 +682,7 @@ mod status {
682682 diesel:: delete ( ps:: table)
683683 . filter ( ps:: id. eq ( layout. site . id ) )
684684 . filter ( ps:: run. gt ( 1 ) )
685- . filter ( ps:: run. lt ( run - ( ENV_VARS . store . prune_keep_history - 1 ) as i32 ) )
685+ . filter ( ps:: run. lt ( run - ( ENV_VARS . store . prune_keep_history as i32 - 1 ) ) )
686686 . execute ( conn)
687687 . map_err ( StoreError :: from) ?;
688688
@@ -768,24 +768,6 @@ mod status {
768768 self . update_table_state ( conn, table, values)
769769 }
770770
771- pub ( crate ) fn copy_final_batch (
772- & self ,
773- conn : & mut PgConnection ,
774- table : & Table ,
775- rows : usize ,
776- batcher : & VidBatcher ,
777- ) -> StoreResult < ( ) > {
778- use prune_table_state as pts;
779-
780- let values = (
781- pts:: next_vid. eq ( batcher. next_vid ( ) ) ,
782- pts:: batch_size. eq ( batcher. batch_size ( ) as i64 ) ,
783- pts:: rows. eq ( pts:: rows + ( rows as i64 ) ) ,
784- ) ;
785-
786- self . update_table_state ( conn, table, values)
787- }
788-
789771 pub ( crate ) fn start_copy_nonfinal (
790772 & self ,
791773 conn : & mut PgConnection ,
@@ -801,7 +783,7 @@ mod status {
801783 self . update_table_state ( conn, table, values)
802784 }
803785
804- pub ( crate ) fn copy_nonfinal_batch (
786+ pub ( crate ) fn copy_batch (
805787 & self ,
806788 conn : & mut PgConnection ,
807789 src : & Table ,
@@ -856,24 +838,6 @@ mod status {
856838 self . update_table_state ( conn, table, values)
857839 }
858840
859- pub ( crate ) fn delete_batch (
860- & self ,
861- conn : & mut PgConnection ,
862- table : & Table ,
863- rows : usize ,
864- batcher : & VidBatcher ,
865- ) -> StoreResult < ( ) > {
866- use prune_table_state as pts;
867-
868- let values = (
869- pts:: next_vid. eq ( batcher. next_vid ( ) ) ,
870- pts:: batch_size. eq ( batcher. batch_size ( ) as i64 ) ,
871- pts:: rows. eq ( pts:: rows - ( rows as i64 ) ) ,
872- ) ;
873-
874- self . update_table_state ( conn, table, values)
875- }
876-
877841 fn update_table_state < V , C > (
878842 & self ,
879843 conn : & mut PgConnection ,
0 commit comments