Skip to content

Commit 995bb8e

Browse files
committed
make the nonsense less nonsense
1 parent d6d31de commit 995bb8e

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

dashboard/app/models/script.rb

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,8 @@ def self.redis
8080
def self.script_cache_from_redis
8181
return unless redis
8282
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
9885
end
9986
end
10087

0 commit comments

Comments
 (0)