Add FASP follow recommendation support (#34964)
This commit is contained in:
parent
ad32834ccd
commit
b2506478ba
7 changed files with 136 additions and 0 deletions
|
|
@ -22,6 +22,10 @@ class AsyncRefresh
|
|||
new(redis_key)
|
||||
end
|
||||
|
||||
def self.exists?(redis_key)
|
||||
redis.exists?(redis_key)
|
||||
end
|
||||
|
||||
attr_reader :status, :result_count
|
||||
|
||||
def initialize(redis_key)
|
||||
|
|
@ -49,6 +53,11 @@ class AsyncRefresh
|
|||
@status = 'finished'
|
||||
end
|
||||
|
||||
def increment_result_count(by: 1)
|
||||
redis.hincrby(@redis_key, 'result_count', by)
|
||||
fetch_data_from_redis
|
||||
end
|
||||
|
||||
def reload
|
||||
fetch_data_from_redis
|
||||
self
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue