mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-18 21:55:08 +00:00
More admin data delete endpoints (#361)
This commit is contained in:
@@ -111,7 +111,6 @@ func Search(ctx context.Context, typ string, entity *Entity, radius float64, num
|
||||
|
||||
// get the index
|
||||
index := getIndex(ctx)
|
||||
|
||||
points := index.KNearest(entity, numEntities, geo.Meters(radius), func(p geo.Point) bool {
|
||||
e, ok := p.(*Entity)
|
||||
if !ok || e.Type != typ {
|
||||
@@ -132,3 +131,11 @@ func Search(ctx context.Context, typ string, entity *Entity, radius float64, num
|
||||
|
||||
return entities
|
||||
}
|
||||
|
||||
func DeleteIndex(tenantID string) error {
|
||||
mtx.Lock()
|
||||
defer mtx.Unlock()
|
||||
delete(indexes, tenantID)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user