mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-11 22:00:25 +08:00
增加刷新、预热缓存任务管理
This commit is contained in:
25
internal/nodes/http_cache_task_manager_test.go
Normal file
25
internal/nodes/http_cache_task_manager_test.go
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
|
||||
package nodes_test
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/caches"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/nodes"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestHTTPCacheTaskManager_Loop(t *testing.T) {
|
||||
// initialize cache policies
|
||||
config, err := nodeconfigs.SharedNodeConfig()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
caches.SharedManager.UpdatePolicies(config.HTTPCachePolicies)
|
||||
|
||||
var manager = nodes.NewHTTPCacheTaskManager()
|
||||
err = manager.Loop()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user