lib/ruote/couch/storage.rb in ruote-couch-2.1.8 vs lib/ruote/couch/storage.rb in ruote-couch-2.1.9
- old
+ new
@@ -118,22 +118,35 @@
end
def purge!
@dbs.values.each { |db| db.purge! }
+ #@dbs.values.each { |db| db.shutdown }
end
+ # Used when doing integration tests, removes all
+ # msgs, schedules, errors, expressions and workitems.
+ #
+ # NOTE that it doesn't remove engine variables (danger)
+ #
+ def clear
+
+ %w[ msgs schedules errors expressions workitems ].each do |type|
+ @dbs[type].purge!
+ end
+ end
+
def dump (type)
@dbs[type].dump
end
def shutdown
@poller.kill if @poller
- @dbs.values.each { |db| db.shutdown }
+ #@dbs.values.each { |db| db.shutdown }
end
# Mainly used by ruote's test/unit/ut_17_storage.rb
#
def add_type (type)
@@ -145,10 +158,10 @@
# Nukes a db type and reputs it (losing all the documents that were in it).
#
def purge_type! (type)
if db = @dbs[type]
- db.purge_docs!
+ db.purge!
end
end
# A provision made for workitems, allow to query them directly by
# participant name.