module JamRuby
  class ScheduledMusicSessionCleaner
    extend Resque::Plugins::JamLonelyJob

    @queue = :scheduled_music_session_cleaner
    @@log = Logging.logger[ScheduledMusicSessionCleaner]

    def self.perform
      @@log.debug("waking up")
      
      MusicSession.purgeable_sessions do |session|
        session.destroy
      end
      @@log.debug("done")
    end

  end
end
