mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Apply syntax_tree formatting to lib/*
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user