Module: SnowyOwl::Persist

Defined in:
lib/snowy_owl/persist.rb

Class Method Summary collapse

Class Method Details

.persist_state(digest) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/snowy_owl/persist.rb', line 8

def persist_state(digest)
  temp_persist_path = SnowyOwl.persist_path + '/.tmp/'
  sub_path = digest
  path = temp_persist_path + sub_path
  FileUtils.mkdir_p path
  args = [sub_path, temp_persist_path]
  SnowyOwl.persist_callback.call(args)
end

.recover_state(digest) ⇒ Object



17
18
19
20
21
# File 'lib/snowy_owl/persist.rb', line 17

def recover_state(digest)
  sub_path = digest
  args = [sub_path, SnowyOwl.persist_path]
  SnowyOwl.recover_callback.call(args)
end