增加PURGE某个URL缓存功能

This commit is contained in:
GoEdgeLab
2021-10-17 20:22:14 +08:00
parent f8da08f5e9
commit dc15e336c2

View File

@@ -1564,9 +1564,13 @@ func (this *ServerService) FindNearbyServers(ctx context.Context, req *pb.FindNe
// PurgeServerCache 清除缓存
func (this *ServerService) PurgeServerCache(ctx context.Context, req *pb.PurgeServerCacheRequest) (*pb.PurgeServerCacheResponse, error) {
_, err := this.ValidateAdmin(ctx, 0)
if err != nil {
// 检查是否为节点
_, err = this.ValidateNode(ctx)
if err != nil {
return nil, err
}
}
if len(req.Domains) == 0 {
return nil, errors.New("'domains' field is required")