Kaynağa Gözat

缓存BUG调整

LD 5 yıl önce
ebeveyn
işleme
b4c80238f0

+ 1 - 0
app/Services/CacheService.php

@@ -9,6 +9,7 @@ use Illuminate\Support\Facades\Cache;
 class CacheService
 {
     function getOrExecute(String $key, $func, $expiration=null){
+        if(!$expiration) $expiration=config('cache.expirations.default');
         return Cache::remember($key, $expiration, $func);
 //        $results = Cache::get($key);
 //        if(!$results){

+ 1 - 1
app/Services/LogisticService.php

@@ -24,7 +24,7 @@ Class LogisticService
                 $query->where("type",$type)->orWhere("type","全部");
             });
             return $query->get();
-        },config('cache.expirations.persistent'));
+        },config('cache.expirations.rarelyChange'));
     }
 
     public function firstOrCreate(array $params, array $values = null){

+ 0 - 2
tests/Unit/EchoTest.php

@@ -2,8 +2,6 @@
 
 namespace Tests\Unit;
 
-use App\Services\CacheService;
-use Illuminate\Support\Facades\Cache;
 use Tests\TestCase;
 
 class EchoTest extends TestCase