diff app/lib/cached_fetch.rb @ 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 7a773720d81f
children
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