fix:删除不存在文档response.IsValid为false引起的异常

This commit is contained in:
李鹏军 2024-04-25 20:23:12 +08:00
parent 62ba69aed9
commit 148434dda0

View File

@ -252,12 +252,9 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract<TrackDetail
foreach (var track in tracks)
{
var r = await Context.DeleteAsync<TrackDetailsIndex>(track.Id, u => u
await Context.DeleteAsync<TrackDetailsIndex>(track.Id, u => u
.Index(track.IndexName)
);
if (!r.IsValid)
throw new Exception($"轨迹数据删除失败,原因:{r.ServerError.Error}");
}
}