Browse Source

Removed geodb sync map cache

Toby Chui 7 months ago
parent
commit
ee48d2dafe
2 changed files with 0 additions and 7 deletions
  1. 0 2
      mod/geodb/geodb.go
  2. 0 5
      mod/geodb/geoloader.go

+ 0 - 2
mod/geodb/geodb.go

@@ -3,7 +3,6 @@ package geodb
 import (
 	_ "embed"
 	"net/http"
-	"sync"
 
 	"imuslab.com/zoraxy/mod/database"
 	"imuslab.com/zoraxy/mod/netutils"
@@ -20,7 +19,6 @@ type Store struct {
 	geodbIpv6   [][]string //Parsed geodb list for ipv6
 	geotrie     *trie
 	geotrieIpv6 *trie
-	geoipCache  sync.Map
 	sysdb       *database.Database
 	option      *StoreOptions
 }

+ 0 - 5
mod/geodb/geoloader.go

@@ -16,11 +16,6 @@ func (s *Store) search(ip string) string {
 		ip = strings.Split(ip, ",")[0]
 		ip = strings.TrimSpace(ip)
 	}
-	//See if there are cached country code for this ip
-	ccc, ok := s.geoipCache.Load(ip)
-	if ok {
-		return ccc.(string)
-	}
 
 	//Search in geotrie tree
 	cc := ""