lib/openwfe/expool/journal_replay.rb in openwferu-0.9.9 vs lib/openwfe/expool/journal_replay.rb in openwferu-0.9.10
- old
+ new
@@ -45,11 +45,11 @@
module OpenWFE
#
# The code decicated to replay and reconstitute journal.
#
- module JournalReplay
+ module JournalReplay
#
# Replays a given journal file.
#
# The offset can be determined by running the analyze() method.
@@ -81,14 +81,16 @@
#puts "expstorage size 1 = #{get_expression_storage.size}"
return unless trigger_action
+ #puts "sds : #{state.dynamic.size}"
+
state.dynamic.each do |ply|
message = ply[0]
- fei = ply[2]
+ fei = extract_fei(ply[2])
wi = ply[3]
if wi
#
# apply, reply, reply_to_parent
@@ -201,11 +203,11 @@
seen = {}
dynamic = []
events.reverse.each do |e|
etype = e[0]
- fei = e[2]
+ fei = extract_fei e[2]
next if etype == :update
next if etype == :remove
#next if etype == :reply_to_parent
next if seen[fei]
next unless participants[fei]
@@ -215,10 +217,11 @@
ExpoolState.new(offset, date, static, dynamic, participants)
end
class ExpoolState
+ include FeiMixin
attr_accessor \
:offset,
:date,
:static,
@@ -239,16 +242,16 @@
s = " ===== offset : #{@offset} #{@date} =====\n"
s << "\n"
s << "static :\n"
@static.each do |e|
- s << " - #{e[0]} #{e[2].to_short_s}\n"
+ s << " - #{e[0]} #{extract_fei(e[2]).to_short_s}\n"
end
s << "\n"
s << "dynamic :\n"
@dynamic.each do |e|
- s << " - #{e[0]} #{e[2].to_short_s}\n"
+ s << " - #{e[0]} #{extract_fei(e[2]).to_short_s}\n"
end
#s << "\n"
#s << "participants :\n"
#@participants.each do |fei, v|