FIX: takes old dashboard out of caching job
This commit is contained in:
parent
0972dd2552
commit
06323f9c89
|
@ -13,9 +13,6 @@ module Jobs
|
|||
# send a message to admins no more often than once per week.
|
||||
GroupMessage.create(Group[:admins].name, :dashboard_problems, limit_once_per: 7.days.to_i)
|
||||
end
|
||||
|
||||
# TODO: decide if we want to keep caching this every 30 minutes
|
||||
AdminDashboardData.refresh_stats
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe Jobs::DashboardStats do
|
||||
it 'caches the stats' do
|
||||
freeze_time
|
||||
|
||||
begin
|
||||
stats = AdminDashboardData.fetch_stats.to_json
|
||||
cache_key = AdminDashboardData.stats_cache_key
|
||||
|
||||
expect($redis.get(cache_key)).to eq(nil)
|
||||
expect(described_class.new.execute({})).to eq(stats)
|
||||
expect($redis.get(cache_key)).to eq(stats)
|
||||
ensure
|
||||
$redis.del(cache_key)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue