mirror of
https://github.com/mastodon/mastodon.git
synced 2025-07-10 06:23:21 +00:00
21 lines
441 B
Ruby
21 lines
441 B
Ruby
# frozen_string_literal: true
|
|
|
|
class HomeFeed < Feed
|
|
def initialize(account)
|
|
@account = account
|
|
super(:home, account.id)
|
|
end
|
|
|
|
def regenerating?
|
|
redis.exists?("account:#{@account.id}:regeneration")
|
|
end
|
|
|
|
def regeneration_in_progress!
|
|
redis.set("account:#{@account.id}:regeneration", true, nx: true, ex: 1.day.seconds)
|
|
end
|
|
|
|
def regeneration_finished!
|
|
redis.del("account:#{@account.id}:regeneration")
|
|
end
|
|
end
|