duqinya лет назад: 5
Родитель
Сommit
0a2c83a8dd
2 измененных файлов с 13 добавлено и 13 удалено
  1. 2 1
      .rocketeer/hooks.php
  2. 11 12
      app/Repositories/CmsContentTemplateSetRepository.php

+ 2 - 1
.rocketeer/hooks.php

@@ -28,7 +28,8 @@ return [
             'composer dumpautoload',
             'chmod -R 777 bootstrap',
             'chmod -R 777 storage',
-            'chmod -R 777 public'
+            'chmod -R 777 public',
+            'service php-fpm reload'
         ],
         'cleanup' => [],
     ],

+ 11 - 12
app/Repositories/CmsContentTemplateSetRepository.php

@@ -227,13 +227,13 @@ class CmsContentTemplateSetRepository
 //            return Cache::store('redis')->get($exchange_key);
 //        }
 
-//        Log::info(Redis::exists($exchange_key));
-//        if (Redis::exists($exchange_key)) {
-//            $result = Redis::get($exchange_key);
-//            $res = json_decode($result, true);
-//            Log::info($res);
-//            return $res;
-//        }
+        Log::info(Redis::exists($exchange_key));
+        if (Redis::exists($exchange_key)) {
+            $result = Redis::get($exchange_key);
+            $res = json_decode($result, true);
+            Log::info($res);
+            return $res;
+        }
 
         $banner_rule = $this->cmsContentTemplateSet->select('id', 'rule')->where(['tpl_id' => $temalates->id, 'area_type' => 0, 'status' => 1])->limit(1)->first();
         $new_rule = [];
@@ -310,11 +310,10 @@ class CmsContentTemplateSetRepository
 //            Cache::store('redis')->put($exchange_key, $group_array, 600);//10分钟过期
 //        }
 //
-//        if (!Redis::exists($exchange_key)) {
-////            Redis::setex($exchange_key, 600, json_encode($group_array));//10分钟过期
-//            Redis::setex($exchange_key, 60, json_encode($group_array));//1分钟过期
-//            Log::debug('兑换商城缓存存储成功-' . json_encode($group_array));
-//        }
+        if (!Redis::exists($exchange_key)) {
+            Redis::setex($exchange_key, 600, json_encode($group_array));//10分钟过期
+            Log::debug('兑换商城缓存存储成功-' . json_encode($group_array));
+        }
 
         return $group_array;
     }