mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	缓存策略可以根据Key前缀进行批量删除
This commit is contained in:
		@@ -12,7 +12,7 @@ import (
 | 
			
		||||
	"github.com/iwind/TeaGo/types"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"strconv"
 | 
			
		||||
	strings "strings"
 | 
			
		||||
	"strings"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type PurgeAction struct {
 | 
			
		||||
@@ -53,6 +53,7 @@ func (this *PurgeAction) RunGet(params struct {
 | 
			
		||||
func (this *PurgeAction) RunPost(params struct {
 | 
			
		||||
	CachePolicyId int64
 | 
			
		||||
	ClusterId     int64
 | 
			
		||||
	Type          string
 | 
			
		||||
	Keys          string
 | 
			
		||||
	Must          *actions.Must
 | 
			
		||||
}) {
 | 
			
		||||
@@ -96,6 +97,11 @@ func (this *PurgeAction) RunPost(params struct {
 | 
			
		||||
		CachePolicyJSON: cachePolicyJSON,
 | 
			
		||||
		Keys:            realKeys,
 | 
			
		||||
	}
 | 
			
		||||
	if params.Type == "prefix" {
 | 
			
		||||
		msg.Type = messageconfigs.PurgeCacheMessageTypeDir
 | 
			
		||||
	} else {
 | 
			
		||||
		msg.Type = messageconfigs.PurgeCacheMessageTypeFile
 | 
			
		||||
	}
 | 
			
		||||
	results, err := nodeutils.SendMessageToCluster(this.AdminContext(), params.ClusterId, messageconfigs.MessageCodePurgeCache, msg, 10)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		this.ErrorPage(err)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user