We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6d31de commit 995bb8eCopy full SHA for 995bb8e
dashboard/app/models/script.rb
@@ -80,21 +80,8 @@ def self.redis
80
def self.script_cache_from_redis
81
return unless redis
82
if marshalled = self.redis['script-cache']
83
- begin
84
- retried = false
85
- Marshal.load marshalled
86
- rescue NameError
87
- # rails tries to do some fancy lazy loading of the database
88
- # connection. If, somehow, this is called before we ever load
89
- # a Script from the database, Marshal.load will get confused
90
- # because not all of the classes Script depends on are
91
- # loaded. Do a silly query to get everything loaded first.
92
- self.exists?
93
- unless retried
94
- retried = true
95
- retry
96
- end
97
+ Script.connection # rails doesn't load the mysql libraries unless you ask it to, this confuses Marshal
+ Marshal.load marshalled
98
end
99
100
0 commit comments