mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:47:22 +08:00
DEV: In test, if flush is called and there is no thread, flush inline (#21426)
This commit is contained in:
parent
608bde734b
commit
ac0673d29e
|
@ -83,10 +83,13 @@ module CachedCounting
|
|||
end
|
||||
|
||||
def self.flush
|
||||
if @thread
|
||||
if @thread && @thread.alive?
|
||||
@flush = true
|
||||
@thread.wakeup
|
||||
sleep 0.001 while @flush
|
||||
else
|
||||
flush_in_memory
|
||||
flush_to_db
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user