milergeo added
This commit is contained in:
@@ -11,11 +11,11 @@ import (
|
||||
|
||||
"doormile/constants"
|
||||
"doormile/db"
|
||||
"doormile/internal/milergeo"
|
||||
"doormile/models"
|
||||
"doormile/utils"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/redis/go-redis/v9"
|
||||
)
|
||||
|
||||
// Catalogue and configuration — §5 of the customer contract.
|
||||
@@ -440,16 +440,7 @@ func milersWithin(lat, lng, radiusKM float64) int {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
|
||||
defer cancel()
|
||||
|
||||
locs, err := db.Rdb.GeoSearchLocation(ctx, "milers:locations", &redis.GeoSearchLocationQuery{
|
||||
GeoSearchQuery: redis.GeoSearchQuery{
|
||||
Longitude: lng,
|
||||
Latitude: lat,
|
||||
Radius: radiusKM,
|
||||
RadiusUnit: "km",
|
||||
Sort: "ASC",
|
||||
Count: 50,
|
||||
},
|
||||
}).Result()
|
||||
locs, err := milergeo.Search(ctx, db.Rdb, lat, lng, radiusKM, 50)
|
||||
if err != nil {
|
||||
utils.Warn("milersWithin: geo search failed", "error", err)
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user