hummingbird-me/hummingbird

View on GitHub
app/workers/trending_groups_refresh_worker.rb

Summary

Maintainability
A
0 mins
Test Coverage
class TrendingGroupsRefreshWorker
  include Sidekiq::Worker
  include Sidetiq::Schedulable

  # Because minutely(int) is slow as balls
  # See tobiassvn/sidetiq#31
  recurrence { hourly.minute_of_hour(00, 05, 10, 15, 20, 25,
                                     30, 35, 40, 45, 50, 55) }

  def perform
    TrendingGroup.connection.execute('REFRESH MATERIALIZED VIEW trending_groups')
  end
end