Class: Atig::Agent::Cleanup

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/atig/agent/clenup.rb

Instance Method Summary collapse

Methods included from ExceptionUtil

daemon, safe

Constructor Details

#initialize(context, api, db) ⇒ Cleanup

Returns a new instance of Cleanup.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/atig/agent/clenup.rb', line 10

def initialize(context, api, db)
  @log = context.log
  daemon do
    db.transaction do|t|
      log :info, "cleanup"
      t.cleanup
    end
    # once a day
    sleep 60*60*24
  end
end