whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [1/1] Commit 76d580d: make nominees list eligable for GC
Date Tue, 23 Feb 2016 15:58:43 GMT
Commit 76d580d72468070280032ef462684859530b6ae6:
    make nominees list eligable for GC


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
lib/whimsy/asf/nominees.rb                                   | ++++++++ --
------------------------------------------------------------
10 changes: 8 additions, 2 deletions.
------------------------------------------------------------


diff --git a/lib/whimsy/asf/nominees.rb b/lib/whimsy/asf/nominees.rb
index da78259..89e478b 100644
--- a/lib/whimsy/asf/nominees.rb
+++ b/lib/whimsy/asf/nominees.rb
@@ -1,9 +1,14 @@
+require 'weakref'
+
 module ASF
 
   class Person < Base
   
     def self.member_nominees
-      return @member_nominees if @member_nominees
+      begin
+        return Hash[@member_nominees.to_a] if @member_nominees
+      rescue NoMethodError, WeakRef::RefError
+      end
 
       meetings = ASF::SVN['private/foundation/Meetings']
       nominations = Dir["#{meetings}/*/nominated-members.txt"].sort.last.untaint
@@ -22,7 +27,8 @@ def self.member_nominees
         nominees[find(id)] = nomination
       end
 
-      @member_nominees = nominees
+      @member_nominees = WeakRef.new(nominees)
+      nominees
     end
 
     def member_nomination

Mime
View raw message