DEV: make developer cache work like other caches (#20817)

This commit is contained in:
Daniel Waterworth 2023-03-27 09:22:33 -05:00 committed by GitHub
parent 05174a6abd
commit 0f4bb19524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -9,11 +9,11 @@ class Developer < ActiveRecord::Base
@id_cache = DistributedCache.new("developer_ids")
def self.user_ids
@id_cache["ids"] || rebuild_cache
@id_cache.defer_get_set("ids") { Set.new(Developer.pluck(:user_id)) }
end
def self.rebuild_cache
@id_cache["ids"] = Set.new(Developer.pluck(:user_id))
@id_cache.clear
end
def rebuild_cache