Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] [PATCH] prevent "year too big to marshal" crashes
@ 2010-02-05 16:19 Eric Sherman
  2010-02-27  7:48 ` Rich Lane
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Sherman @ 2010-02-05 16:19 UTC (permalink / raw)
  To: sup-devel

Xapian::Document#entry= performs a Marshal.dump which was throwing a
"year too big to marshal" when adding a new message.  I just
truncate_date'd the message's date when the entry hash is created in
sync_message and this problem went away for me.

It was a spam message, as the MIN_DATE/MAX_DATE comments hinted.
---
 lib/sup/xapian_index.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/xapian_index.rb b/lib/sup/xapian_index.rb
index 443b88d..44531a2 100644
--- a/lib/sup/xapian_index.rb
+++ b/lib/sup/xapian_index.rb
@@ -435,7 +435,7 @@ EOS
       :message_id => m.id,
       :source_id => m.source.id,
       :source_info => m.source_info,
-      :date => m.date,
+      :date => truncate_date(m.date),
       :snippet => snippet,
       :labels => m.labels.to_a,
       :from => [m.from.email, m.from.name],
-- 
1.6.6

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


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

end of thread, other threads:[~2010-02-27  7:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-05 16:19 [sup-devel] [PATCH] prevent "year too big to marshal" crashes Eric Sherman
2010-02-27  7:48 ` Rich Lane

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