| In: |
libraries/madeleine_service.rb
|
| Parent: | Object |
| SNAPSHOT_INTERVAL | = | 30 * 60 * 24 |
| AUTOMATIC_SNAPSHOTS | = | true |
Clears all the command_log and snapshot files located in the storage directory, so the database is essentially dropped and recreated as blank. Used in tests.
# File libraries/madeleine_service.rb, line 39
39: def self.clean_storage(service)
40: require 'fileutils'
41: if (File.directory?(service.storage_path))
42: FileUtils.rm_rf(Dir[service.storage_path + '/*.command_log'])
43: FileUtils.rm_rf(Dir[service.storage_path + '/*.snapshot'])
44: else
45: FileUtils.mkdir_p(service.storage_path)
46: end
47: end
# File libraries/madeleine_service.rb, line 49
49: def initialize(service)
50: marshaller = Madeleine::ZMarshal.new()
51: @server = Madeleine::Automatic::AutomaticSnapshotMadeleine.new(service.storage_path,
52: marshaller) { service.new }
53: start_snapshot_thread if AUTOMATIC_SNAPSHOTS
54: end