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:13 UTC
[apisix-go-plugin-runner] 06/22: refacor: rename method
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 d35ce282abf44818c49cdec6d336eb1dbd1b4183
Author: spacewander <sp...@gmail.com>
AuthorDate: Wed May 19 15:30:56 2021 +0800
refacor: rename method
---
internal/plugin/conf.go | 2 +-
internal/plugin/conf_test.go | 6 +++---
internal/server/error_test.go | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/internal/plugin/conf.go b/internal/plugin/conf.go
index ae7d0c6..6c79cb6 100644
--- a/internal/plugin/conf.go
+++ b/internal/plugin/conf.go
@@ -37,7 +37,7 @@ var (
cacheCounter uint32 = 0
)
-func InitCache(ttl time.Duration) {
+func InitConfCache(ttl time.Duration) {
cache = ttlcache.NewCache()
cache.SetTTL(ttl)
cache.SkipTTLExtensionOnHit(false)
diff --git a/internal/plugin/conf_test.go b/internal/plugin/conf_test.go
index 1b2e668..b4135a5 100644
--- a/internal/plugin/conf_test.go
+++ b/internal/plugin/conf_test.go
@@ -26,7 +26,7 @@ import (
)
func TestPrepareConf(t *testing.T) {
- InitCache(10 * time.Millisecond)
+ InitConfCache(10 * time.Millisecond)
builder := flatbuffers.NewBuilder(1024)
pc.ReqStart(builder)
@@ -44,7 +44,7 @@ func TestPrepareConf(t *testing.T) {
}
func TestGetRuleConf(t *testing.T) {
- InitCache(1 * time.Millisecond)
+ InitConfCache(1 * time.Millisecond)
builder := flatbuffers.NewBuilder(1024)
pc.ReqStart(builder)
root := pc.ReqEnd(builder)
@@ -64,7 +64,7 @@ func TestGetRuleConf(t *testing.T) {
}
func TestGetRuleConfCheckConf(t *testing.T) {
- InitCache(1 * time.Millisecond)
+ InitConfCache(1 * time.Millisecond)
builder := flatbuffers.NewBuilder(1024)
name := builder.CreateString("echo")
diff --git a/internal/server/error_test.go b/internal/server/error_test.go
index 9586ba5..4d8bb21 100644
--- a/internal/server/error_test.go
+++ b/internal/server/error_test.go
@@ -25,7 +25,7 @@ import (
)
func TestReportErrorCacheToken(t *testing.T) {
- plugin.InitCache(10 * time.Millisecond)
+ plugin.InitConfCache(10 * time.Millisecond)
_, err := plugin.GetRuleConf(uint32(999999))
b := ReportError(err)