我在 DropBox 中保存了一些巨大的文件夹,其中包含超过 10k 的文件。我想检查那里是否存在文件列表,但我无法获取父文件夹上的元数据,因为我超过了 10k 限制。
所以我编写了代码来检查文件列表中的每个文件是否存在。
我无法弄清楚将同时运行多少个请求以及如何将这个数字增加到我的机器可以处理的最大值?
foreach(string f in files)
{
client.GetMetaDataAsync("/blah/blah/" + f, (response) =>
{
found.Add(f);
count++;
Console.WriteLine("{0} of {1} found - {2}", count, files.Count, f);
},
(error) =>
{
if (error.Message.Contains("[NotFound]"))
{
missing.Add(f);
count++;
Console.WriteLine("{0} of {1} missing - {2}", count, files.Count, f);
}
else
{
Console.WriteLine("Unknown error");
}
});
}