Browse Source

Merge branch 'master' into Haozi

haozi 5 năm trước cách đây
mục cha
commit
dd1085e70c

+ 0 - 2
.gitlab-ci.yml

@@ -12,8 +12,6 @@ before_script:
   - sudo bash ci/installEnv.sh
   - sudo bash ci/installEnv.sh
 
 
 
 
-
-
 build:
 build:
   stage: build
   stage: build
   tags:
   tags:

+ 1 - 0
app/Services/CacheService.php

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

+ 1 - 1
app/Services/LogisticService.php

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

+ 0 - 2
tests/Unit/EchoTest.php

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