You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by sp...@apache.org on 2021/05/31 02:07:22 UTC

[apisix-go-plugin-runner] 15/22: chore: pass lint

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 <sp...@gmail.com>
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
 }