lib/openwfe/expool/expstorage.rb in openwferu-0.9.15 vs lib/openwfe/expool/expstorage.rb in openwferu-0.9.16

- old
+ new

@@ -36,17 +36,17 @@ # # Nicolas Modrzyk at openwfe.org # John Mettraux at openwfe.org # -#require 'monitor' require 'fileutils' require 'openwfe/service' require 'openwfe/util/lru' require 'openwfe/flowexpressionid' + module OpenWFE # # This module contains the observe_expool method which binds the # storage to the expression pool. @@ -134,11 +134,11 @@ #ldebug { "[] (sz #{@cache.size}) for #{fei.to_debug_s}" } fe = @cache[fei.hash] return fe if fe - ldebug { "[] (reload) for #{fei.to_debug_s}" } + #ldebug { "[] (reload) for #{fei.to_debug_s}" } fe = get_real_storage[fei] unless fe #ldebug { "[] (reload) miss for #{fei.to_debug_s}" } @@ -149,10 +149,13 @@ fe end def []= (fei, fe) + + #linfo { "[]= caching #{fei}" } + @cache[fei.hash] = fe end def delete (fei) @cache.delete fei.hash @@ -242,13 +245,11 @@ # # Allows to pass a block to each expressions of a given kind (type). # def each_of_kind (kind, &block) - return unless block - self.each_value do |fexp| - block.call(fexp) if fexp.kind_of?(kind) + block.call(fexp.fei, fexp) if fexp.kind_of?(kind) end end def each (wfid_prefix=nil, &block)