|
@@ -153,7 +153,7 @@ namespace TEAMModelOS.Controllers.Core
|
|
await _azureRedis.GetRedisClient(8).SortedSetRemoveAsync($"Blob:Catalog:{blobContainerName}", u);
|
|
await _azureRedis.GetRedisClient(8).SortedSetRemoveAsync($"Blob:Catalog:{blobContainerName}", u);
|
|
catalog[u] = 0;
|
|
catalog[u] = 0;
|
|
}
|
|
}
|
|
- var messageBlob = new ServiceBusMessage(new { id = Guid.NewGuid().ToString(), progress = "update", name = blobContainerName }.ToJsonString());
|
|
|
|
|
|
+ var messageBlob = new ServiceBusMessage(new { id = Guid.NewGuid().ToString(), progress = "update",root=new string[] { u }, name = blobContainerName }.ToJsonString());
|
|
messageBlob.ApplicationProperties.Add("name", "Blob");
|
|
messageBlob.ApplicationProperties.Add("name", "Blob");
|
|
var ActiveTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
|
|
var ActiveTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
|
|
await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageBlob);
|
|
await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageBlob);
|
|
@@ -227,9 +227,11 @@ namespace TEAMModelOS.Controllers.Core
|
|
long? useSize = blobSize + urlSize.Select(x=>x.size).Sum();
|
|
long? useSize = blobSize + urlSize.Select(x=>x.size).Sum();
|
|
await _azureRedis.GetRedisClient(8).HashSetAsync($"Blob:Record", blobContainerName, useSize);
|
|
await _azureRedis.GetRedisClient(8).HashSetAsync($"Blob:Record", blobContainerName, useSize);
|
|
Dictionary<string, double?> catalog = new Dictionary<string, double?>();
|
|
Dictionary<string, double?> catalog = new Dictionary<string, double?>();
|
|
|
|
+ HashSet<string> root = new HashSet<string>();
|
|
foreach (var x in urlSize)
|
|
foreach (var x in urlSize)
|
|
{
|
|
{
|
|
string u = System.Web.HttpUtility.UrlDecode(x.url, Encoding.UTF8).Split("/")[0];
|
|
string u = System.Web.HttpUtility.UrlDecode(x.url, Encoding.UTF8).Split("/")[0];
|
|
|
|
+ root.Add(u);
|
|
//释放文件夹空间
|
|
//释放文件夹空间
|
|
await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Blob:Catalog:{blobContainerName}", u, -x.size);
|
|
await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Blob:Catalog:{blobContainerName}", u, -x.size);
|
|
catalog[u] = await _azureRedis.GetRedisClient(8).SortedSetScoreAsync($"Blob:Catalog:{blobContainerName}", u);
|
|
catalog[u] = await _azureRedis.GetRedisClient(8).SortedSetScoreAsync($"Blob:Catalog:{blobContainerName}", u);
|
|
@@ -239,7 +241,7 @@ namespace TEAMModelOS.Controllers.Core
|
|
catalog[u] = 0;
|
|
catalog[u] = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- var messageBlob = new ServiceBusMessage(new { id = Guid.NewGuid().ToString(), progress = "update", name = blobContainerName }.ToJsonString());
|
|
|
|
|
|
+ var messageBlob = new ServiceBusMessage(new { id = Guid.NewGuid().ToString(), progress = "update", root = root.ToArray(), name = blobContainerName }.ToJsonString());
|
|
messageBlob.ApplicationProperties.Add("name", "Blob");
|
|
messageBlob.ApplicationProperties.Add("name", "Blob");
|
|
var ActiveTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
|
|
var ActiveTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
|
|
await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageBlob);
|
|
await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageBlob);
|
|
@@ -427,8 +429,10 @@ namespace TEAMModelOS.Controllers.Core
|
|
long? useSize = blobSize + disSize;
|
|
long? useSize = blobSize + disSize;
|
|
await _azureRedis.GetRedisClient(8).HashSetAsync($"Blob:Record", name, useSize);
|
|
await _azureRedis.GetRedisClient(8).HashSetAsync($"Blob:Record", name, useSize);
|
|
Dictionary<string, double?> catalog = new Dictionary<string, double?>();
|
|
Dictionary<string, double?> catalog = new Dictionary<string, double?>();
|
|
|
|
+ HashSet<string> root = new HashSet<string>();
|
|
foreach (var x in urls) {
|
|
foreach (var x in urls) {
|
|
string u = System.Web.HttpUtility.UrlDecode(x.url, Encoding.UTF8).Split("/")[0];
|
|
string u = System.Web.HttpUtility.UrlDecode(x.url, Encoding.UTF8).Split("/")[0];
|
|
|
|
+ root.Add(u);
|
|
await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Blob:Catalog:{name}", u, x.size);
|
|
await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Blob:Catalog:{name}", u, x.size);
|
|
catalog[u]= await _azureRedis.GetRedisClient(8).SortedSetScoreAsync($"Blob:Catalog:{name}", u);
|
|
catalog[u]= await _azureRedis.GetRedisClient(8).SortedSetScoreAsync($"Blob:Catalog:{name}", u);
|
|
if (catalog[u] < 0) {
|
|
if (catalog[u] < 0) {
|
|
@@ -436,7 +440,7 @@ namespace TEAMModelOS.Controllers.Core
|
|
catalog[u] = 0;
|
|
catalog[u] = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- var messageBlob = new ServiceBusMessage(new {id=Guid.NewGuid().ToString(), progress = "update",name=name}.ToJsonString());
|
|
|
|
|
|
+ var messageBlob = new ServiceBusMessage(new {id=Guid.NewGuid().ToString(), progress = "update", root= root.ToArray(), name=name}.ToJsonString());;
|
|
messageBlob.ApplicationProperties.Add("name", "Blob");
|
|
messageBlob.ApplicationProperties.Add("name", "Blob");
|
|
var ActiveTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
|
|
var ActiveTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
|
|
await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageBlob);
|
|
await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageBlob);
|