|
@@ -4,6 +4,7 @@ using Azure.Messaging.ServiceBus;
|
|
using Azure.Storage.Blobs;
|
|
using Azure.Storage.Blobs;
|
|
using DocumentFormat.OpenXml.Wordprocessing;
|
|
using DocumentFormat.OpenXml.Wordprocessing;
|
|
using HTEXLib.COMM.Helpers;
|
|
using HTEXLib.COMM.Helpers;
|
|
|
|
+using Microsoft.Azure.Cosmos.Table;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.Configuration;
|
|
using StackExchange.Redis;
|
|
using StackExchange.Redis;
|
|
using System;
|
|
using System;
|
|
@@ -187,13 +188,44 @@ namespace TEAMModelOS.SDK.Services
|
|
else if (percent <= 0)
|
|
else if (percent <= 0)
|
|
{
|
|
{
|
|
tag = 0;
|
|
tag = 0;
|
|
- }//如果已经扩容请忽略此通知!
|
|
|
|
- //if()
|
|
|
|
|
|
+ }
|
|
|
|
+ //如果已经扩容请忽略此通知!
|
|
|
|
+ string key = scope.Equals("school",StringComparison.OrdinalIgnoreCase)? $"Blob:Space:School:Notify:{name}" : "Blob:Space:Private:Notify";
|
|
|
|
+ //string filed=
|
|
|
|
+ if (tag < 11)
|
|
|
|
+ {
|
|
|
|
+ BlobSpaceNotify? blobSpaceNotify = null;
|
|
|
|
+ RedisValue value = _azureRedis.GetRedisClient(8).HashGet(key, name);
|
|
|
|
+ if (value != default && !value.IsNullOrEmpty)
|
|
|
|
+ {
|
|
|
|
+ JsonElement record = value.ToString().ToObject<JsonElement>();
|
|
|
|
+ }
|
|
|
|
+ blobSpaceNotify = new BlobSpaceNotify { };
|
|
|
|
+ await _azureRedis.GetRedisClient(8).HashSetAsync(key, name, blobSpaceNotify.ToJsonString());
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
return (usedSize, teach, total, surplus, catalog);
|
|
return (usedSize, teach, total, surplus, catalog);
|
|
}
|
|
}
|
|
-
|
|
|
|
- public class BlobSpace{ }
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 记录在redis,使用ttl 进行过期管理
|
|
|
|
+ /// </summary>
|
|
|
|
+ public class BlobSpaceNotify
|
|
|
|
+ {
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// id=$"{tmdid}-{tag}"
|
|
|
|
+ /// </summary>
|
|
|
|
+ public string? id { get; set; }
|
|
|
|
+ public int tag { get; set; }
|
|
|
|
+ public string? containerName { get; set; }
|
|
|
|
+ public string? scope { get; set; }
|
|
|
|
+ public string? notifyIndex { get; set; }
|
|
|
|
+ }
|
|
|
|
|
|
/// <param name="scope">school or private</param>
|
|
/// <param name="scope">school or private</param>
|
|
/// <param name="containerName">school code or tmid</param>
|
|
/// <param name="containerName">school code or tmid</param>
|