From 12088fb1d4d33770a4e0603648db87ac11405b5c Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Thu, 3 Jun 2021 17:01:55 +0100 Subject: [PATCH] fix url panic --- url/generate.go | 1 + url/handler/url.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/url/generate.go b/url/generate.go index 96f431a..7d9db91 100644 --- a/url/generate.go +++ b/url/generate.go @@ -1,2 +1,3 @@ package main + //go:generate make proto diff --git a/url/handler/url.go b/url/handler/url.go index ef48c70..db3fbf1 100644 --- a/url/handler/url.go +++ b/url/handler/url.go @@ -121,7 +121,7 @@ func (e *Url) Proxy(ctx context.Context, req *url.ProxyRequest, rsp *url.ProxyRe e.cache.Set(id, int64(1), cache.NoExpiration) } else { // we null out the counter - e.cache.Set(id, 0, cache.NoExpiration) + e.cache.Set(id, int64(0), cache.NoExpiration) if v.(int64)%10 == 0 { go func() { // We add instead of set in case the service runs in multiple