File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,18 @@ def initialize(raw, topic_id)
99 def cook ( *args )
1010 cooked = PrettyText . cook ( *args )
1111
12- # If we have any of the oneboxes in the cache, throw them in right away, don't
13- # wait for the post processor.
12+ # cook all oneboxes, in the past we used to defer this
13+ # for some reason we decided to do this inline now
14+ # TODO: discuss on http://meta.discourse.org what the correct thing is to do
15+ # keep in mind some oneboxes may take a long time to build
1416 result = Oneboxer . apply ( cooked ) do |url , elem |
1517 Oneboxer . invalidate ( url ) if args . last [ :invalidate_oneboxes ]
16- Oneboxer . onebox url
18+ begin
19+ Oneboxer . onebox url
20+ rescue => e
21+ Rails . logger . warn ( "Failed to cook onebox: #{ e . message } #{ e . backtrace } " )
22+ nil
23+ end
1724 end
1825
1926 cooked = result . to_html if result . changed?
You can’t perform that action at this time.
0 commit comments