Commit Graph

1 Commits

Author SHA1 Message Date
Zach Pendleton 30832ea301 remove messages older than 360 days
fixes CNVS-9304

this commit also replaces the current MessageScrubber
class and moves its old function to the aptly named
DelayedMessageScrubber.

test plan:
  * in a rails console, run the following in a rails
    console:

  Setting.set('message_scrubber_limit', 7)
  scrubber = MessageScrubber.new
  scrubber.scrub_all

  * verify that all messages older than 7 days
    have been deleted and that messages newser than
    7 days (assuming you have any) still exist. you
    can do this by running the following in a rails
    console:

  # this should be 0
  Message.where('sent_at < ?', scrubber.limit).count

  # this should be > 0
  Message.where('sent_at > ?', scrubber.limit).count

Change-Id: I6c054971b3bcc8ec5a436edf4454ff0f0952f41b
Reviewed-on: https://gerrit.instructure.com/26017
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
2013-11-07 17:19:59 +00:00