|
@@ -149,10 +149,11 @@ namespace TEAMModelFunction
|
|
|
/// </summary>
|
|
|
/// <param name="msg"></param>
|
|
|
/// <returns></returns>
|
|
|
- public async Task BlobRoot([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "blobroot", Connection = "Azure:ServiceBus:ConnectionString")] string msg) {
|
|
|
+ [FunctionName("BlobRoot")]
|
|
|
+ public async Task BlobRoot([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "blobroot", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
|
|
|
+ {
|
|
|
try
|
|
|
{
|
|
|
- // await _dingDing.SendBotMsg($"ServiceBus,Blob(){msg}", GroupNames.醍摩豆服務運維群組);
|
|
|
var jsonMsg = JsonDocument.Parse(msg);
|
|
|
if (jsonMsg.RootElement.TryGetProperty("name", out JsonElement name) && name.ValueKind == JsonValueKind.String
|
|
|
&& jsonMsg.RootElement.TryGetProperty("root", out JsonElement root) && root.ValueKind == JsonValueKind.String)
|
|
@@ -163,9 +164,10 @@ namespace TEAMModelFunction
|
|
|
var size = await client.GetBlobsSize(u);
|
|
|
await _azureRedis.GetRedisClient(8).SortedSetRemoveAsync($"Blob:Catalog:{name}", u);
|
|
|
await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Blob:Catalog:{name}", u, size.HasValue ? size.Value : 0);
|
|
|
- var scores= await _azureRedis.GetRedisClient(8).SortedSetRangeByRankWithScoresAsync($"Blob:Catalog:{name}");
|
|
|
+ var scores = await _azureRedis.GetRedisClient(8).SortedSetRangeByRankWithScoresAsync($"Blob:Catalog:{name}");
|
|
|
double blobsize = 0;
|
|
|
- if (scores != default &&scores!=null) {
|
|
|
+ if (scores != default && scores != null)
|
|
|
+ {
|
|
|
foreach (var score in scores)
|
|
|
{
|
|
|
blobsize = blobsize + score.Score;
|
|
@@ -182,7 +184,7 @@ namespace TEAMModelFunction
|
|
|
await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Blob()\n{ex.Message}{ex.StackTrace}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
/// <summary>
|
|
|
/// 完善课程变更,StuListChange, originCode是学校编码 则表示名单是学校自定义名单,如果是tmdid则表示醍摩豆的私有名单,scope=school,private。
|