DEV: Apply syntax_tree formatting to lib/*

This commit is contained in:
David Taylor
2023-01-09 12:10:19 +00:00
parent b0fda61a8e
commit 6417173082
507 changed files with 16550 additions and 12627 deletions

View File

@@ -1,23 +1,16 @@
# frozen_string_literal: true
require 'message_bus/distributed_cache'
require "message_bus/distributed_cache"
class DistributedCache < MessageBus::DistributedCache
def initialize(key, manager: nil, namespace: true)
super(
key,
manager: manager,
namespace: namespace,
app_version: Discourse.git_version
)
super(key, manager: manager, namespace: namespace, app_version: Discourse.git_version)
end
# Defer setting of the key in the cache for performance critical path to avoid
# waiting on MessageBus to publish the message which involves writing to Redis.
def defer_set(k, v)
Scheduler::Defer.later("#{@key}_set") do
self[k] = v
end
Scheduler::Defer.later("#{@key}_set") { self[k] = v }
end
def defer_get_set(k, &block)