PERF: perform all cached counting in background (#15991)

Previously cached counting made redis calls in main thread and performed
the flush in main thread.

This could lead to pathological states in extreme heavy load.

This refactor reduces load and cleans up the interface
This commit is contained in:
Sam
2022-02-23 03:45:25 +11:00
committed by GitHub
parent 98a7fa3d1a
commit d4d3580761
9 changed files with 367 additions and 370 deletions

View File

@@ -194,6 +194,8 @@ RSpec.configure do |config|
config.infer_base_class_for_anonymous_controllers = true
config.before(:suite) do
CachedCounting.disable
begin
ActiveRecord::Migration.check_pending!
rescue ActiveRecord::PendingMigrationError