This is an automated email from the ASF dual-hosted git repository.

spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-go-plugin-runner.git

commit d825c844afaa8b4e3a19287930a12936b7b6879f
Author: spacewander <[email protected]>
AuthorDate: Tue May 25 15:40:41 2021 +0800

    chore: pass lint
---
 internal/plugin/conf.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/internal/plugin/conf.go b/internal/plugin/conf.go
index 3b3a8bb..5c4dccf 100644
--- a/internal/plugin/conf.go
+++ b/internal/plugin/conf.go
@@ -20,6 +20,7 @@ import (
        "time"
 
        "github.com/ReneKroon/ttlcache/v2"
+       "github.com/apache/apisix-go-plugin-runner/internal/log"
        "github.com/apache/apisix-go-plugin-runner/internal/util"
        A6 "github.com/api7/ext-plugin-proto/go/A6"
        pc "github.com/api7/ext-plugin-proto/go/A6/PrepareConf"
@@ -39,7 +40,10 @@ var (
 
 func InitConfCache(ttl time.Duration) {
        cache = ttlcache.NewCache()
-       cache.SetTTL(ttl)
+       err := cache.SetTTL(ttl)
+       if err != nil {
+               log.Fatalf("failed to set global ttl for cache: %s", err)
+       }
        cache.SkipTTLExtensionOnHit(false)
        cacheCounter = 0
 }

Reply via email to