Skip to content

Commit 6d74b53

Browse files
committed
fix: MessageTemplate cache expiration
1 parent ceb91f0 commit 6d74b53

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/models/message_template.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class MessageTemplate < ApplicationRecord
22
class << self
33
# Maximum amount of time to use the in-memory singleton before checking the database for updates.
4-
SINGLETON_MAX_AGE = 30.seconds.from_now
4+
SINGLETON_MAX_AGE = 30.seconds
55

66
# Retrieve the instance.
77
# Use the one stored in memory if it is recent enough.
@@ -23,7 +23,7 @@ def load_singleton
2323
if none?
2424
replace_with_default
2525
end
26-
@singleton_expiration = SINGLETON_MAX_AGE
26+
@singleton_expiration = SINGLETON_MAX_AGE.from_now
2727
@singleton_instance = uncached_instance
2828
end
2929

0 commit comments

Comments
 (0)