Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] to_time_s
@ 2007-11-28  2:19 Andrei Maxim
  2007-11-28 17:08 ` William Morgan
  0 siblings, 1 reply; 3+ messages in thread
From: Andrei Maxim @ 2007-11-28  2:19 UTC (permalink / raw)


Hi guys,

I just grabbed the latest sup using `sudo gem install sup` after seeing the
announce on RubyTalk, configured my Gmail account and did a `sup-sync` and
this is what I got:

[Wed Nov 28 03:50:30 +0200 2007] unlocking /Users/andrei/.sup/lock...
/usr/local/lib/ruby/gems/1.8/gems/sup-0.3/bin/sup-sync:14:in `to_i':
Infinity (FloatDomainError)
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/bin/sup-sync:14:in
`to_time_s'
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/bin/sup-sync:182
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/lib/sup/poll.rb:158:in
`add_messages_from'
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/lib/sup/imap.rb:170:in
`each'
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/lib/sup/imap.rb:158:in
`upto'
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/lib/sup/imap.rb:158:in
`each'
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/lib/sup/util.rb:533:in
`send'
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/lib/sup/util.rb:533:in
`__pass'
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/lib/sup/util.rb:522:in
`method_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/lib/sup/poll.rb:140:in
`add_messages_from'
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/lib/sup/util.rb:496:in
`send'
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/lib/sup/util.rb:496:in
`method_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/bin/sup-sync:134
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/bin/sup-sync:129:in
`each'
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/bin/sup-sync:129
        from /usr/local/bin/sup-sync:16:in `load'
        from /usr/local/bin/sup-sync:16

Here's the line of the code that's causing the issues:

$stderr.puts "## #{num_scanned} (#{pctdone}%) read; #{elapsed.to_time_s}
elapsed; #{remaining.to_time_s} remaining"

It seems that the time difference is way too big. The mailbox is not so big,
around 400 MB according to Gmail, but I have a couple of months of high
traffic emails like Rails and RubyTalk. Sup detects that I have 66844 emails
in the INBOX folder.

If needed, I could send a patch.

-- 
Andrei Maxim
http://andreimaxim.ro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/sup-talk/attachments/20071128/d0463ad2/attachment-0001.html 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [sup-talk] to_time_s
  2007-11-28  2:19 [sup-talk] to_time_s Andrei Maxim
@ 2007-11-28 17:08 ` William Morgan
  2007-11-29  0:58   ` Andrei Maxim
  0 siblings, 1 reply; 3+ messages in thread
From: William Morgan @ 2007-11-28 17:08 UTC (permalink / raw)


Excerpts from Andrei Maxim's message of Tue Nov 27 18:19:43 -0800 2007:
> [Wed Nov 28 03:50:30 +0200 2007] unlocking /Users/andrei/.sup/lock...
> /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/bin/sup-sync:14:in `to_i':
> Infinity (FloatDomainError)

Heh. Does this patch help?

--- bin/sup-sync        (revision 731)
+++ bin/sup-sync        (working copy)
@@ -7,6 +7,9 @@
 
 class Float
   def to_s; sprintf '%.2f', self; end
+  def to_time_s
+    infinite? ? "unknown" : super
+  end
 end

-- 
William <wmorgan-sup at masanjin.net>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [sup-talk] to_time_s
  2007-11-28 17:08 ` William Morgan
@ 2007-11-29  0:58   ` Andrei Maxim
  0 siblings, 0 replies; 3+ messages in thread
From: Andrei Maxim @ 2007-11-29  0:58 UTC (permalink / raw)


On 11/28/07, William Morgan <wmorgan-sup at masanjin.net> wrote:
>
> Excerpts from Andrei Maxim's message of Tue Nov 27 18:19:43 -0800 2007:
> > [Wed Nov 28 03:50:30 +0200 2007] unlocking /Users/andrei/.sup/lock...
> > /usr/local/lib/ruby/gems/1.8/gems/sup-0.3/bin/sup-sync:14:in `to_i':
> > Infinity (FloatDomainError)
>
> Heh. Does this patch help?
>
> --- bin/sup-sync        (revision 731)
> +++ bin/sup-sync        (working copy)
> @@ -7,6 +7,9 @@
>
> class Float
>    def to_s; sprintf '%.2f', self; end
> +  def to_time_s
> +    infinite? ? "unknown" : super
> +  end
> end
>

I have decided to delete most of the emails and it worked ok. But thanks for
the patch :)

-- 
Andrei Maxim
http://andreimaxim.ro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/sup-talk/attachments/20071129/57c172b4/attachment.html 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-29  0:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-28  2:19 [sup-talk] to_time_s Andrei Maxim
2007-11-28 17:08 ` William Morgan
2007-11-29  0:58   ` Andrei Maxim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox