More admin data delete endpoints (#361)

This commit is contained in:
Dominic Wong
2022-02-02 12:09:24 +00:00
committed by GitHub
parent e3a83152fe
commit e0bb9a8765
10 changed files with 152 additions and 4 deletions

View File

@@ -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
}