Improve speed of timezone fetch for UserOption

Improve speed of timezone fetch for UserOption

diff --git a/jobs/scheduled/check_logs_game.rb b/jobs/scheduled/check_logs_game.rb
index d597cb5..60e8aab 100644
--- a/jobs/scheduled/check_logs_game.rb
+++ b/jobs/scheduled/check_logs_game.rb
@@ -95,7 +95,7 @@ module Jobs
       end
 
       def user_tzinfo(user_id)
-        timezone = UserOption.select(:timezone).find(user_id).timezone || "UTC"
+        timezone = UserOption.where(user_id: user_id).pluck(:timezone).first || "UTC"
 
         tzinfo = nil
         begin

GitHub sha: 5b70ddd6

1 Like