changeset 239:c800506ae799 legit-client

More varied cache period for less chance of hitting rate limit
author nanaya <me@nanaya.net>
date Sat, 15 Jul 2023 01:59:44 +0900
parents a04b4830eef2
children c454ea4f7b34
files app/lib/cached_fetch.rb
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/app/lib/cached_fetch.rb	Sat Jul 15 01:53:05 2023 +0900
+++ b/app/lib/cached_fetch.rb	Sat Jul 15 01:59:44 2023 +0900
@@ -12,6 +12,6 @@
   end
 
   def self.cached(key, &block)
-    Rails.cache.fetch(key, expires_in: (15 + rand(15)).minutes, &block)
+    Rails.cache.fetch(key, expires_in: (15 + rand(60)).minutes, &block)
   end
 end