feat: support max running tasks config (#112)

This commit is contained in:
Li Wei authored and GitHub committed 2023-05-10 18:00:58 +08:00
1 parent 1e08ecd8db
commit d9c5ca339f
22 files changed
+269 -129

No files matched your search

+3 -7
View File
@@ -170,8 +170,7 @@ func TestDownloader_Protocol_Config(t *testing.T) {
}
storeCfg := &DownloaderStoreConfig{
RefreshInterval: 500,
DownloadDir: "./downloads",
DownloadDir: "./downloads",
ProtocolConfig: map[string]any{
"http": map[string]any{
"connections": 4,
@@ -191,17 +190,14 @@ func TestDownloader_Protocol_Config(t *testing.T) {
},
}
if err := downloader.PutConfig(storeCfg); err != nil {
if err = downloader.PutConfig(storeCfg); err != nil {
t.Fatal(err)
}
exits, newStoreCfg, err := downloader.GetConfig()
newStoreCfg, err := downloader.GetConfig()
if err != nil {
t.Fatal(err)
}
if !exits {
t.Errorf("GetConfig() got = %v, want %v", exits, true)
}
if !test.JsonEqual(storeCfg, newStoreCfg) {
t.Errorf("GetConfig() got = %v, want %v", test.ToJson(storeCfg), test.ToJson(newStoreCfg))