From 95435d64ef046d8b4e3b3830629a27e7aa15eaa0 Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Wed, 25 Oct 2023 18:22:45 +0800 Subject: [PATCH] feat: im admin token cache --- pkg/common/apicall/call.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/common/apicall/call.go b/pkg/common/apicall/call.go index 7e2c1054..870ef094 100644 --- a/pkg/common/apicall/call.go +++ b/pkg/common/apicall/call.go @@ -69,10 +69,9 @@ func (a caller[Req, Resp]) Call(ctx context.Context, req *Req) (*Resp, error) { func (a caller[Req, Resp]) call(ctx context.Context, req *Req) (*Resp, error) { url := a.prefix() + a.api - start := time.Now() - defer func() { - log.ZDebug(ctx, "call caller", "api", a.api, "cost", time.Since(start)) - }() + defer func(start time.Time) { + log.ZDebug(ctx, "api call caller time", "api", a.api, "cost", time.Since(start).String()) + }(time.Now()) log.ZInfo(ctx, "caller req", "addr", url, "req", req) reqBody, err := json.Marshal(req) if err != nil {