fix: load more close relays to allow for duplicate results

This commit is contained in:
Kieran 2024-03-15 16:30:22 +00:00
parent 4ec40984d6
commit 0a42894a6f

View File

@ -142,9 +142,13 @@ public class RedisStore
{ {
var ret = new Dictionary<Uri, RelayDistance>(); var ret = new Dictionary<Uri, RelayDistance>();
var geoRelays = var geoRelays =
await _database.GeoSearchAsync(RelayPositionKey(), lon, lat, new GeoSearchCircle(radius), count); await _database.GeoSearchAsync(RelayPositionKey(), lon, lat, new GeoSearchCircle(radius), count * 2);
foreach (var gr in geoRelays) foreach (var gr in geoRelays)
{ {
if (ret.Count == count)
{
break;
}
var id = ((string)gr.Member!).Split('\x1'); var id = ((string)gr.Member!).Split('\x1');
var u = new Uri(id[0]); var u = new Uri(id[0]);
var info = await GetRelay(u); var info = await GetRelay(u);