From 371e756307eca25d65d051c57e7dd065bdd81967 Mon Sep 17 00:00:00 2001 From: yusing Date: Wed, 28 May 2025 22:14:10 +0800 Subject: [PATCH] refactor: small refactor on maxmind code --- internal/maxmind/maxmind.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/internal/maxmind/maxmind.go b/internal/maxmind/maxmind.go index 4337005..ec32991 100644 --- a/internal/maxmind/maxmind.go +++ b/internal/maxmind/maxmind.go @@ -34,11 +34,16 @@ type ( City = maxmind.City ) -var ( +const ( updateInterval = 24 * time.Hour - httpClient = &http.Client{ - Timeout: 10 * time.Second, - } + updateTimeout = 10 * time.Second +) + +var httpClient = &http.Client{ + Timeout: updateTimeout, +} + +var ( ErrResponseNotOK = gperr.New("response not OK") ErrDownloadFailure = gperr.New("download failure") )