DEV: In test, if flush is called and there is no thread, flush inline (#21426)

This commit is contained in:
Sam
2023-05-08 13:25:00 +10:00
committed by GitHub
parent 608bde734b
commit ac0673d29e

View File

@@ -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