lib/dirty_pipeline/storage.rb in dirty_pipeline-0.2.0 vs lib/dirty_pipeline/storage.rb in dirty_pipeline-0.3.0
- old
+ new
@@ -15,20 +15,21 @@
end
def init_store(store_field)
self.store = subject.send(store_field).to_h
clear! if store.empty?
- return if (store.keys & %w(status events errors state)).size == 4
+ return if (store.keys & %w(cache status events errors state)).size == 5
raise InvalidPipelineStorage, store
end
def clear
self.store = subject.send(
"#{field}=",
"status" => nil,
"pipeline_status" => nil,
"state" => {},
+ "cache" => {},
"events" => [],
"errors" => [],
)
DirtyPipeline.with_redis { |r| r.del(pipeline_status_key) }
end
@@ -97,9 +98,10 @@
store["pipeline_status"] = value
end
def commit_pipeline_status!(value = nil)
self.pipeline_status = value
+ store["cache"].clear
commit!
end
alias :reset_pipeline_status! :commit_pipeline_status!
def pipeline_status