lib/ruote/exp/ro_persist.rb in ruote-2.1.1 vs lib/ruote/exp/ro_persist.rb in ruote-2.1.2
- old
+ new
@@ -53,21 +53,21 @@
def try_persist
r = @context.storage.put(@h)
#puts "+ per #{h.fei['expid']} #{tree.first} #{h._rev} --> #{r.class}"
- #Ruote.p_caller('+ per') if r != nil
+ #Ruote.p_caller('+ per') if r != nil || h.fei['expid'] == '0_0'
r
end
def try_unpersist
r = @context.storage.delete(@h)
#puts "- unp #{h.fei['expid']} #{tree.first} #{h._rev} --> #{r.class}"
- #Ruote.p_caller('- unp') if r != nil
+ #Ruote.p_caller('- unp') if r != nil || h.fei['expid'] == '0_0'
return r if r
if h.has_error
@@ -121,18 +121,16 @@
def do_p (pers)
case r = self.send("try_#{pers}")
when true
- (pers == :unpersist)
- # persist FALSE : gone... return false "please don't go on"
- # unpersist TRUE : already gone, should be OK
+ false # don't go on
when Hash
self.h = r
self.send("do_#{@msg['action']}", @msg)
- false
+ false # don't go on
else
- true
+ true # success, please go on
end
end
end
end