File tree Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -80,21 +80,8 @@ def self.redis
80
80
def self . script_cache_from_redis
81
81
return unless redis
82
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
- end
83
+ Script . connection # rails doesn't load the mysql libraries unless you ask it to, this confuses Marshal
84
+ Marshal . load marshalled
98
85
end
99
86
end
100
87
You can’t perform that action at this time.
0 commit comments