Redis fixes
This commit is contained in:
parent
8d48c3ce3d
commit
1214b0664c
|
@ -3,6 +3,7 @@
|
||||||
class Api::V1::ExpensesController < EmptyController
|
class Api::V1::ExpensesController < EmptyController
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
amount = 0
|
||||||
Redis.current.with do |conn|
|
Redis.current.with do |conn|
|
||||||
amount = conn.get("monthly_funding_amount") || 0
|
amount = conn.get("monthly_funding_amount") || 0
|
||||||
end
|
end
|
||||||
|
|
|
@ -479,16 +479,18 @@ class Account < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def clean_feed_manager
|
def clean_feed_manager
|
||||||
reblog_key = FeedManager.instance.key(:home, id, 'reblogs')
|
Redis.current.with do |conn|
|
||||||
reblogged_id_set = Redis.current.zrange(reblog_key, 0, -1)
|
reblog_key = FeedManager.instance.key(:home, id, 'reblogs')
|
||||||
|
reblogged_id_set = conn.zrange(reblog_key, 0, -1)
|
||||||
|
|
||||||
Redis.current.pipelined do
|
conn.pipelined do
|
||||||
Redis.current.del(FeedManager.instance.key(:home, id))
|
conn.del(FeedManager.instance.key(:home, id))
|
||||||
Redis.current.del(reblog_key)
|
conn.del(reblog_key)
|
||||||
|
|
||||||
reblogged_id_set.each do |reblogged_id|
|
reblogged_id_set.each do |reblogged_id|
|
||||||
reblog_set_key = FeedManager.instance.key(:home, id, "reblogs:#{reblogged_id}")
|
reblog_set_key = FeedManager.instance.key(:home, id, "reblogs:#{reblogged_id}")
|
||||||
Redis.current.del(reblog_set_key)
|
conn.del(reblog_set_key)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -101,7 +101,11 @@ class AccountConversation < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def subscribed_to_timeline?
|
def subscribed_to_timeline?
|
||||||
Redis.current.exists?("subscribed:#{streaming_channel}")
|
exists = false
|
||||||
|
Redis.current.with do |conn|
|
||||||
|
exists = conn.exists?("subscribed:#{streaming_channel}")
|
||||||
|
end
|
||||||
|
exists
|
||||||
end
|
end
|
||||||
|
|
||||||
def streaming_channel
|
def streaming_channel
|
||||||
|
|
Loading…
Reference in New Issue