mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-06 18:10:25 +08:00
增加PURGE某个URL缓存功能
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user