mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Revert "FIX: Always clear caches after committing the current transaction" (#22493)
This reverts commit 8310c7842c.
This was breaking precompilation.
This commit is contained in:
committed by
GitHub
parent
9dd01ca2ef
commit
cb794275a7
@@ -773,14 +773,14 @@ module Discourse
|
||||
def self.received_postgres_readonly!
|
||||
time = Time.zone.now
|
||||
redis.set(LAST_POSTGRES_READONLY_KEY, time.to_i.to_s)
|
||||
postgres_last_read_only.clear(after_commit: false)
|
||||
postgres_last_read_only.clear
|
||||
|
||||
time
|
||||
end
|
||||
|
||||
def self.clear_postgres_readonly!
|
||||
redis.del(LAST_POSTGRES_READONLY_KEY)
|
||||
postgres_last_read_only.clear(after_commit: false)
|
||||
postgres_last_read_only.clear
|
||||
end
|
||||
|
||||
def self.received_redis_readonly!
|
||||
|
||||
@@ -19,12 +19,4 @@ class DistributedCache < MessageBus::DistributedCache
|
||||
self.defer_set(k, value)
|
||||
value
|
||||
end
|
||||
|
||||
def clear(after_commit: true)
|
||||
if after_commit
|
||||
DB.after_commit { super() }
|
||||
else
|
||||
super()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user