@@ -255,13 +255,11 @@ pub fn list(pools: HashMap<Shard, ConnectionPool>) -> Result<(), Error> {
255255}
256256
257257pub fn status ( pools : HashMap < Shard , ConnectionPool > , dst : & DeploymentSearch ) -> Result < ( ) , Error > {
258+ const CHECK : & str = "✓" ;
259+
258260 use catalog:: active_copies as ac;
259261 use catalog:: deployment_schemas as ds;
260262
261- fn done ( ts : & Option < UtcDateTime > ) -> String {
262- ts. map ( |_| "✓" ) . unwrap_or ( "." ) . to_string ( )
263- }
264-
265263 fn duration ( start : & UtcDateTime , end : & Option < UtcDateTime > ) -> String {
266264 let start = * start;
267265 let end = * end;
@@ -314,7 +312,7 @@ pub fn status(pools: HashMap<Shard, ConnectionPool>, dst: &DeploymentSearch) ->
314312 } ;
315313
316314 let progress = match & state. finished_at {
317- Some ( _) => done ( & state . finished_at ) ,
315+ Some ( _) => CHECK . to_string ( ) ,
318316 None => {
319317 let target: i64 = tables. iter ( ) . map ( |table| table. target_vid ) . sum ( ) ;
320318 let next: i64 = tables. iter ( ) . map ( |table| table. next_vid ) . sum ( ) ;
@@ -363,13 +361,15 @@ pub fn status(pools: HashMap<Shard, ConnectionPool>, dst: &DeploymentSearch) ->
363361 ) ;
364362 println ! ( "{:-<74}" , "-" ) ;
365363 for table in tables {
366- let status = if table . next_vid > 0 && table. next_vid < table . target_vid {
367- ">" . to_string ( )
368- } else if table . target_vid < 0 {
364+ let status = match & table. finished_at {
365+ // table finished
366+ Some ( _ ) => CHECK ,
369367 // empty source table
370- "✓" . to_string ( )
371- } else {
372- done ( & table. finished_at )
368+ None if table. target_vid < 0 => CHECK ,
369+ // copying in progress
370+ None if table. duration_ms > 0 => ">" ,
371+ // not started
372+ None => "." ,
373373 } ;
374374 println ! (
375375 "{} {:<28} | {:>8} | {:>8} | {:>8} | {:>8}" ,
0 commit comments