From: William Morgan Date: Mon, 4 May 2009 12:48:17 +0000 (-0700) Subject: Merge branch 'sup-sync-improvements' into next X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=5088681ea1f8b2d054eb6b8bdc3ecc4ef8e22dfb;p=sup Merge branch 'sup-sync-improvements' into next Conflicts: bin/sup-sync --- 5088681ea1f8b2d054eb6b8bdc3ecc4ef8e22dfb diff --cc bin/sup-sync index 79343e6,01dbaa7..01c0eba --- a/bin/sup-sync +++ b/bin/sup-sync @@@ -173,16 -184,8 +184,16 @@@ begi ## nothin! use default source labels end + if Time.now - last_info_time > PROGRESS_UPDATE_INTERVAL + last_info_time = Time.now + elapsed = last_info_time - start_time + pctdone = source.respond_to?(:pct_done) ? source.pct_done : 100.0 * (source.cur_offset.to_f - source.start_offset).to_f / (source.end_offset - source.start_offset).to_f + remaining = (100.0 - pctdone) * (elapsed.to_f / pctdone) + $stderr.printf "## read %dm (about %.0f%%) @ %.1fm/s. %s elapsed, about %s remaining\n", num_scanned, pctdone, num_scanned / elapsed, elapsed.to_time_s, remaining.to_time_s + end + if index_state.nil? - puts "Adding message #{source}##{offset} with state {#{m.labels * ', '}}" if opts[:verbose] + puts "Adding message #{source}##{offset} from #{m.from} with state {#{m.labels * ', '}}" if opts[:verbose] num_added += 1 else puts "Updating message #{source}##{offset}, source #{entry[:source_id]} => #{source.id}, offset #{entry[:source_info]} => #{offset}, state {#{index_state * ', '}} => {#{m.labels * ', '}}" if opts[:verbose]