Parcourir la source

:fire: 被注释掉的cache

visuddhinanda il y a 1 an
Parent
commit
e5eef5e658
1 fichiers modifiés avec 10 ajouts et 28 suppressions
  1. 10 28
      app/Http/Controllers/CorpusController.php

+ 10 - 28
app/Http/Controllers/CorpusController.php

@@ -724,34 +724,16 @@ class CorpusController extends Controller
                                                 });
                             break;
                         default:
-                        /**
-                         * 译文需要markdown渲染
-                         * 包涵术语的不用cache
-                         */
-                            if(strpos($row->content,'[[')===false){
-                                $newSent['html'] = MdRender::render($row->content,[$row->channel_uid],
-                                                            null,$mode,'translation',
-                                                            $row->content_type,$format);
-                                /*
-                                RedisClusters::remember("/sent/{$channelId}/{$currSentId}/{$format}",
-                                                    config('mint.cache.expire'),
-                                                function() use($row,$mode,$format){
-                                                    return MdRender::render($row->content,[$row->channel_uid],
-                                                                            null,$mode,'translation',
-                                                                            $row->content_type,$format);
-                                                });
-                                            */
-                            }else{
-                                $mdRender = new MdRender(
-                                    [
-                                        'debug'=>$this->debug,
-                                        'format'=>$format,
-                                        'mode'=>$mode,
-                                        'channelType'=>'translation',
-                                        'contentType'=>$row->content_type,
-                                    ]);
-                                $newSent['html'] = $mdRender->convert($row->content,[$row->channel_uid]);
-                            }
+                            $options = [
+                                    'debug'=>$this->debug,
+                                    'format'=>$format,
+                                    'mode'=>$mode,
+                                    'channelType'=>'translation',
+                                    'contentType'=>$row->content_type,
+                            ];
+                            $mdRender = new MdRender($options);
+                            $newSent['html'] = $mdRender->convert($row->content,[$row->channel_uid]);
+                            Log::debug('md render',['content'=>$row->content,'options'=>$options,'render'=>$newSent['html']]);
                             break;
                     }
                 }