Class: AutosyncThread
- Inherits:
-
BaseThread
- Object
- Thread
- BaseThread
- AutosyncThread
- Defined in:
- lib/daemon/autosync_thread.rb
Instance Attribute Summary collapse
-
#files_to_delete ⇒ Object
Returns the value of attribute files_to_delete.
-
#items_to_delete ⇒ Object
Returns the value of attribute items_to_delete.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
Instance Method Summary collapse
Methods inherited from BaseThread
Constructor Details
This class inherits a constructor from BaseThread
Instance Attribute Details
#files_to_delete ⇒ Object
Returns the value of attribute files_to_delete.
4 5 6 |
# File 'lib/daemon/autosync_thread.rb', line 4 def files_to_delete @files_to_delete end |
#items_to_delete ⇒ Object
Returns the value of attribute items_to_delete.
4 5 6 |
# File 'lib/daemon/autosync_thread.rb', line 4 def items_to_delete @items_to_delete end |
#start_time ⇒ Object
Returns the value of attribute start_time.
4 5 6 |
# File 'lib/daemon/autosync_thread.rb', line 4 def start_time @start_time end |
Instance Method Details
#go(storages) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/daemon/autosync_thread.rb', line 5 def go(storages) storages.each do |storage| $log.debug("AutosyncThread: Run storage synchronization for #{storage.name}") Autosync.new(storage).run storage.reload storage.autosync_at = Time.now.to_i storage.save $log.debug("AutosyncThread: Finish storage synchronization for #{storage.name}") break if $exit_signal end end |