2016-10-19 03:11:36 +00:00
|
|
|
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
|
2016-04-18 00:02:31 +00:00
|
|
|
|
|
|
|
class HttpLog < ApplicationModel
|
|
|
|
store :request
|
|
|
|
store :response
|
|
|
|
|
|
|
|
=begin
|
|
|
|
|
|
|
|
cleanup old http logs
|
|
|
|
|
|
|
|
HttpLog.cleanup
|
|
|
|
|
2016-08-17 11:24:51 +00:00
|
|
|
optional you can put the max oldest chat entries as argument
|
2016-04-18 00:02:31 +00:00
|
|
|
|
|
|
|
HttpLog.cleanup(1.month)
|
|
|
|
|
|
|
|
=end
|
|
|
|
|
|
|
|
def self.cleanup(diff = 1.month)
|
|
|
|
HttpLog.where('created_at < ?', Time.zone.now - diff).delete_all
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|