|
@@ -31,6 +31,14 @@ using Microsoft.Azure.Cosmos.Linq;
|
|
|
using System.Net.Http.Json;
|
|
|
using System.Threading;
|
|
|
using System.Text.Json.Nodes;
|
|
|
+using System.Web;
|
|
|
+using Azure.Storage.Blobs;
|
|
|
+using static TEAMModelOS.SDK.CoreAPIHttpService;
|
|
|
+using static Google.Protobuf.Reflection.SourceCodeInfo.Types;
|
|
|
+using System.Net;
|
|
|
+using Newtonsoft.Json;
|
|
|
+using System.Security.Policy;
|
|
|
+using System.Net.Http.Headers;
|
|
|
namespace TEAMModelOS.Function
|
|
|
{
|
|
|
public class IESServiceBusTrigger
|
|
@@ -72,10 +80,15 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
[Function("GenPDF")]
|
|
|
public async Task Run(
|
|
|
- [ServiceBusTrigger("genpdf", Connection = "Azure:ServiceBus:ConnectionString")]
|
|
|
+ [ServiceBusTrigger("dep-genpdf", Connection = "Azure:ServiceBus:ConnectionString" , IsBatched =false) ]
|
|
|
ServiceBusReceivedMessage message,
|
|
|
ServiceBusMessageActions messageActions)
|
|
|
{
|
|
|
+ message.lo
|
|
|
+ // await messageActions.RenewMessageLockAsync(message);
|
|
|
+ long time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
|
|
+ Console.WriteLine($"開始:{time}");
|
|
|
+ string apiUri = "http://52.130.252.100:13000";
|
|
|
long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
|
|
_logger.LogInformation("Message ID: {id}", message.MessageId);
|
|
|
_logger.LogInformation("Message Body: {body}", message.Body);
|
|
@@ -101,27 +114,101 @@ namespace TEAMModelOS.Function
|
|
|
client.Timeout= TimeSpan.FromMilliseconds(genQueueData.timeout+ genQueueData.delay+5000);
|
|
|
try
|
|
|
{
|
|
|
- HttpResponseMessage responseMessage = await client.PostAsJsonAsync("http://52.130.252.100:13000/api/pdf", new { pageUrl = genQueueData.pageUrl, timeout = genQueueData.timeout, delay = genQueueData.delay, checkPageCompleteJs = genQueueData.checkPageCompleteJs });
|
|
|
+ string urlpdf =$"{apiUri}/api/pdf";
|
|
|
+ string jsonElement= new {
|
|
|
+ pageUrl = genQueueData.pageUrl,
|
|
|
+ timeout = genQueueData.timeout,
|
|
|
+ delay = genQueueData.delay,
|
|
|
+ checkPageCompleteJs = genQueueData.checkPageCompleteJs
|
|
|
+ }.ToJsonString();
|
|
|
+
|
|
|
+ var request = new HttpRequestMessage
|
|
|
+ {
|
|
|
+ Method = new HttpMethod("POST"),
|
|
|
+ RequestUri = new Uri(urlpdf),
|
|
|
+ Content = new StringContent(jsonElement)
|
|
|
+ };
|
|
|
+ var mediaTypeHeader = new MediaTypeHeaderValue("application/json")
|
|
|
+ {
|
|
|
+ CharSet = "UTF-8"
|
|
|
+ };
|
|
|
+ request.Content.Headers.ContentType = mediaTypeHeader;
|
|
|
+ HttpResponseMessage responseMessage = await client.SendAsync(request);
|
|
|
if (responseMessage.IsSuccessStatusCode)
|
|
|
{
|
|
|
string content = await responseMessage.Content.ReadAsStringAsync();
|
|
|
JsonNode jsonNode = content.ToObject<JsonNode>();
|
|
|
var code = jsonNode["code"];
|
|
|
- var file = jsonNode["code"]?["data"]?["file"];
|
|
|
+ var file = jsonNode["data"]?["file"];
|
|
|
if (code!=null && $"{code}".Equals("0") && file!= null && !string.IsNullOrWhiteSpace($"{file}"))
|
|
|
{
|
|
|
- //所以步骤执行成功
|
|
|
- genRedis.status=2;
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ Stream stream = await client.GetStreamAsync($"{apiUri}/{file}");
|
|
|
+ Uri uri = new Uri(genQueueData.pageUrl);
|
|
|
+ var query = HttpUtility.ParseQueryString(uri.Query);
|
|
|
+ string? url = query["url"];
|
|
|
+ if (!string.IsNullOrWhiteSpace(url))
|
|
|
+ {
|
|
|
+ url= HttpUtility.UrlDecode(url);
|
|
|
+ uri = new Uri(url);
|
|
|
+ string host = uri.Host;
|
|
|
+ var blobServiceClient = _azureStorage.GetBlobServiceClient();
|
|
|
+ if (blobServiceClient.Uri.Host.Equals(host))
|
|
|
+ {
|
|
|
+ // 获取容器名,它是路径的第一个部分
|
|
|
+ string containerName = uri.Segments[1].TrimEnd('/');
|
|
|
+
|
|
|
+ // 获取文件的完整同级目录,这是文件路径中除了文件名和扩展名之外的部分
|
|
|
+ // 由于文件名是路径的最后一个部分,我们可以通过连接除了最后一个部分之外的所有部分来获取目录路径
|
|
|
+ string directoryPath = string.Join("", uri.Segments, 2, uri.Segments.Length - 3);
|
|
|
+ string? fileName = Path.GetFileNameWithoutExtension(uri.AbsolutePath);
|
|
|
+ string blobPath = $"{directoryPath}{fileName}.pdf";
|
|
|
+ var blockBlob = _azureStorage.GetBlobContainerClient(containerName).GetBlobClient(blobPath);
|
|
|
+ string content_type = "application/octet-stream";
|
|
|
+ ContentTypeDict.dict.TryGetValue(".pdf", out string? contenttype);
|
|
|
+ if (!string.IsNullOrEmpty(contenttype))
|
|
|
+ {
|
|
|
+ content_type = contenttype;
|
|
|
+ }
|
|
|
+ await blockBlob.UploadAsync(stream, true);
|
|
|
+ blockBlob.SetHttpHeaders(new BlobHttpHeaders { ContentType = content_type });
|
|
|
+ genRedis.blob= blockBlob.Name;
|
|
|
+ genRedis.status=2;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ genRedis.status=6;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ genRedis.status=6;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,GenPDF()\n{ex.Message}\n{ex.StackTrace}\n\n{json.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ genRedis.status=6;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (code!= null&& $"{code}".Equals("99999"))
|
|
|
+ if (code!= null && $"{code}".Equals("99999"))
|
|
|
{
|
|
|
genRedis.status= 4;
|
|
|
|
|
|
}
|
|
|
+ else {
|
|
|
+ genRedis.status= 3;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ else {
|
|
|
+ genRedis.status= 3;
|
|
|
+ }
|
|
|
}
|
|
|
catch (TaskCanceledException ex)
|
|
|
{
|
|
@@ -144,15 +231,177 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- genRedis= new PDFGenRedis { id =genQueueData.id, status= 5, cost=0, join=now, wait=0 };
|
|
|
+ genRedis= new PDFGenRedis { id =genQueueData.id, status= 5, cost=0, join=now, wait=0,name= genQueueData .name };
|
|
|
//被取消的
|
|
|
}
|
|
|
|
|
|
- long nowNew = DateTimeOffset.Now.ToUnixTimeSeconds();
|
|
|
+ long nowNew = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
|
|
genRedis.cost=nowNew-now;
|
|
|
await _azureRedis.GetRedisClient(8).HashSetAsync($"PDFGen:{genQueueData.sessionId}", genQueueData.id, genRedis.ToJsonString());
|
|
|
//如果全部 生成,需要发送通知
|
|
|
- // 数据大于60一个班,发送报告的总耗时等概要信息, 小于60的发送 生成报告的细则消息,小于五个的,可以列出报告的链接,
|
|
|
+
|
|
|
+ HashEntry[] datas = await _azureRedis.GetRedisClient(8).HashGetAllAsync($"PDFGen:{genQueueData.sessionId}");
|
|
|
+ List<PDFGenRedis> dbgenRedis = new List<PDFGenRedis>();
|
|
|
+ List<string> notifyUsers = new List<string>();
|
|
|
+ string taskName = string.Empty;
|
|
|
+ string taskType = string.Empty;
|
|
|
+ if (datas!= null && datas.Length > 0)
|
|
|
+ {
|
|
|
+ foreach (var item in datas)
|
|
|
+ {
|
|
|
+ if (!$"{item.Name}".Contains("notifyUsers"))
|
|
|
+ {
|
|
|
+ dbgenRedis.Add(item.Value.ToString().ToObject<PDFGenRedis>());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var jsonData = item.Value.ToString().ToObject<JsonElement>();
|
|
|
+ notifyUsers= jsonData.GetProperty("notifyUsers").ToObject<List<string>>();
|
|
|
+ taskType = jsonData.GetProperty("taskType").ToString();
|
|
|
+ taskName = jsonData.GetProperty("taskName").ToString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (notifyUsers.IsNotEmpty())
|
|
|
+ {
|
|
|
+ string lang = Environment.GetEnvironmentVariable("Option:Location")!.Contains("China") ? "zh-cn" : "en-us";
|
|
|
+ string sql = $"select c.id, c.name ,c.lang as code from c where c.id in ({string.Join(",", notifyUsers.Select(x => $"'{x}'"))})";
|
|
|
+ List<IdNameCode> idNameCodes = new List<IdNameCode>();
|
|
|
+ await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher)
|
|
|
+ .GetItemQueryIteratorSql<IdNameCode>(queryText: sql, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("Base") }))
|
|
|
+ {
|
|
|
+ idNameCodes.Add(item);
|
|
|
+ }
|
|
|
+ idNameCodes.FindAll(x => string.IsNullOrWhiteSpace(x.code) || (!x.code.Equals("zh-cn") && !x.code.Equals("zh-tw") && !x.code.Equals("en-us"))).ForEach(x => { x.code = lang; });
|
|
|
+
|
|
|
+ var clientID = _configuration.GetValue<string>("HaBookAuth:CoreService:clientID");
|
|
|
+ var clientSecret = _configuration.GetValue<string>("HaBookAuth:CoreService:clientSecret");
|
|
|
+ var url = _configuration.GetValue<string>("HaBookAuth:CoreAPI");
|
|
|
+ string location = "China";
|
|
|
+ if (Environment.GetEnvironmentVariable("Option:Location")!.Contains("China"))
|
|
|
+ {
|
|
|
+ location = "China";
|
|
|
+ }
|
|
|
+ else if (Environment.GetEnvironmentVariable("Option:Location")!.Contains("Global"))
|
|
|
+ {
|
|
|
+ location = "Global";
|
|
|
+ }
|
|
|
+ var token = await CoreTokenExtensions.CreateAccessToken(clientID, clientSecret, location);
|
|
|
+ var client = _httpClient.CreateClient();
|
|
|
+ if (client.DefaultRequestHeaders.Contains("Authorization"))
|
|
|
+ {
|
|
|
+ client.DefaultRequestHeaders.Remove("Authorization");
|
|
|
+ client.DefaultRequestHeaders.Add("Authorization", $"Bearer {token.AccessToken}");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ client.DefaultRequestHeaders.Add("Authorization", $"Bearer {token.AccessToken}");
|
|
|
+ }
|
|
|
+ //检查dbgenRedis的状态是否全部已经不是0和1
|
|
|
+ var unfinished = dbgenRedis.FindAll(x => (x.status==0||x.status==1));
|
|
|
+
|
|
|
+ if (unfinished==null || unfinished.Count==0)
|
|
|
+ {
|
|
|
+ // 数据大于60一个班,发送报告的总耗时等概要信息, 小于60的发送 生成报告的细则消息,小于五个的,可以列出报告的链接.
|
|
|
+ long joinTime = dbgenRedis.Min(x => x.join);
|
|
|
+ long totalTime = (now-joinTime)/1000;
|
|
|
+ long costTime = dbgenRedis.Sum(x => x.cost)/1000;
|
|
|
+ long avgTime = costTime / dbgenRedis.Count;
|
|
|
+ long maxTime = dbgenRedis.Max(x => x.cost)/1000;
|
|
|
+ long minTime = dbgenRedis.Min(x => x.cost)/1000;
|
|
|
+ long statusOk = dbgenRedis.Where(x => x.status==2).Count();
|
|
|
+ long statusFailed = dbgenRedis.Where(x => x.status!=2).Count();
|
|
|
+ string key = "pdf-gen-notify-higher60";
|
|
|
+
|
|
|
+ if (dbgenRedis.Count>60)
|
|
|
+ {
|
|
|
+ key = "pdf-gen-notify-higher60";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ key ="pdf-gen-notify-below60";
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach (var teacher in idNameCodes)
|
|
|
+ {
|
|
|
+ string path = Path.Combine("", $"Lang/{teacher.code}.json");
|
|
|
+ var sampleJson = File.ReadAllText(path);
|
|
|
+ JsonElement jsonElement = sampleJson.ToObject<JsonElement>();
|
|
|
+ JsonElement msgsJson = jsonElement.GetProperty(key);
|
|
|
+ List<string> msgs = msgsJson.ToObject<List<string>>();
|
|
|
+ string msg1 = msgs[1].Replace("{tmdname}", teacher.name).Replace("{taskName}", taskName).Replace("{totalTime}",$"{totalTime}")
|
|
|
+ .Replace("{avgTime}",$"{avgTime}").Replace("{maxTime}",$"{maxTime}").Replace("{minTime}",$"{minTime}").Replace("{statusOk}",$"{statusOk}").Replace("{statusFailed}",$"{statusFailed}");
|
|
|
+ StringBuilder sb = new StringBuilder($"{msg1}");
|
|
|
+ if (dbgenRedis.Count<=60)
|
|
|
+ {
|
|
|
+ string status = string.Empty;
|
|
|
+ dbgenRedis.ForEach(x => {
|
|
|
+ switch (x.status)
|
|
|
+ {
|
|
|
+ case 0:
|
|
|
+ status= teacher.code.Equals("zh-cn") ? "未执行" : teacher.code.Equals("zh-tw") ? "未執行" : "unexecuted";
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ status= teacher.code.Equals("zh-cn") ? "执行中" : teacher.code.Equals("zh-tw") ? "執行中" : "executing";
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ status= teacher.code.Equals("zh-cn") ? "成功" : teacher.code.Equals("zh-tw") ? "成功" : "success";
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ status= teacher.code.Equals("zh-cn") ? "失败" : teacher.code.Equals("zh-tw") ? "失敗" : "failed";
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ status= teacher.code.Equals("zh-cn") ? "超时" : teacher.code.Equals("zh-tw") ? "超時" : "timeout";
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ status= teacher.code.Equals("zh-cn") ? "取消" : teacher.code.Equals("zh-tw") ? "取消" : "canceled";
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ status= teacher.code.Equals("zh-cn") ? "存放异常" : teacher.code.Equals("zh-tw") ? "存放異常" : "SaveError";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ status= teacher.code.Equals("zh-cn") ? "失败" : teacher.code.Equals("zh-tw") ? "失敗" : "failed";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ string msg2 = msgs[2].Replace("{studentName}",x.name).Replace("{status}", $"{status}").Replace("{wait}", $"{x.wait/1000}").Replace("{cost}", $"{x.cost/1000}").Replace("{total}", $"{(x.wait+x.cost)/1000}");
|
|
|
+ sb.Append(msg2);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ NotifyData notifyData = new NotifyData
|
|
|
+ {
|
|
|
+ hubName = "hita5",
|
|
|
+ sender = "IES",
|
|
|
+ tags = new List<string> { $"{teacher.id}_{Constant.NotifyType_IES5_Course}"},
|
|
|
+ title = msgs[0],
|
|
|
+ eventId = $"{key}_{_snowflakeId.NextId()}",
|
|
|
+ eventName =msgs[0],
|
|
|
+ data = "{\"value\":{}}",
|
|
|
+ body=sb.ToString(),
|
|
|
+ };
|
|
|
+ string result = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+ HttpResponseMessage responseMessage =await client.PostAsJsonAsync($"{url}/service/PushNotify", notifyData);
|
|
|
+ if (responseMessage.StatusCode == HttpStatusCode.OK)
|
|
|
+ {
|
|
|
+ string content = await responseMessage.Content.ReadAsStringAsync();
|
|
|
+ result = content;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ result = $"{responseMessage.StatusCode},推送返回的状态码。";
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception exm)
|
|
|
+ {
|
|
|
+ _= _dingDing.SendBotMsg($"{location}站点发送消息异常,{exm.Message}\n{exm.StackTrace}:\n{url}/service/PushNotify \nheader: {token.AccessToken} \nresult:{result}\n params:{notifyData.ToJsonString()}", GroupNames.成都开发測試群組);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Console.WriteLine($"結束:{time}");
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -1128,7 +1377,7 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- // await _dingDing.SendBotMsg($"{_option.Location}/LessonRecordEvent/课堂记录更新课堂时长出错records/{_lessonId}/Record/.Recording.json\n{ex.Message}\n{ex.StackTrace}{msg}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ // await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}/LessonRecordEvent/课堂记录更新课堂时长出错records/{_lessonId}/Record/.Recording.json\n{ex.Message}\n{ex.StackTrace}{msg}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
isReplace = true;
|
|
|
break;
|
|
@@ -1181,7 +1430,7 @@ namespace TEAMModelOS.Function
|
|
|
{
|
|
|
if (!ex.Message.Contains("The specified blob does not exist"))
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{_option.Location},TimeLine.json转换异常,{ex.Message}{ex.StackTrace},{lessonRecord.id}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")},TimeLine.json转换异常,{ex.Message}{ex.StackTrace},{lessonRecord.id}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
}
|
|
|
//读取Task.json
|
|
@@ -1195,7 +1444,7 @@ namespace TEAMModelOS.Function
|
|
|
{
|
|
|
if (!ex.Message.Contains("The specified blob does not exist"))
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{_option.Location},Task.json转换异常,{ex.Message}{ex.StackTrace},{lessonRecord.id}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")},Task.json转换异常,{ex.Message}{ex.StackTrace},{lessonRecord.id}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
}
|
|
|
//读取IRS.json
|
|
@@ -1210,14 +1459,14 @@ namespace TEAMModelOS.Function
|
|
|
{
|
|
|
if (!ex.Message.Contains("The specified blob does not exist"))
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{_option.Location},IRS.json转换异常,{ex.Message}{ex.StackTrace},{lessonRecord.id}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")},IRS.json转换异常,{ex.Message}{ex.StackTrace},{lessonRecord.id}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//如果有更新 则去读取/{_lessonId}/IES/base.json
|
|
|
try
|
|
|
{
|
|
|
- // await _dingDing.SendBotMsg($"{_option.Location},课堂id:{_lessonId} 收到更新", GroupNames.醍摩豆服務運維群組);
|
|
|
+ // await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")},课堂id:{_lessonId} 收到更新", GroupNames.醍摩豆服務運維群組);
|
|
|
BlobDownloadResult baseblobDownload = await _azureStorage.GetBlobContainerClient(blobname).GetBlobClient($"/records/{_lessonId}/IES/base.json").DownloadContentAsync();
|
|
|
//attendState
|
|
|
string basejson = baseblobDownload.Content.ToString().Replace("\"Uncall\"", "0").Replace("Uncall", "0");
|
|
@@ -1228,7 +1477,7 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{_option.Location},base.json转换异常,{ex.Message}{ex.StackTrace}{basejson},{lessonRecord.id}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")},base.json转换异常,{ex.Message}{ex.StackTrace}{basejson},{lessonRecord.id}", GroupNames.成都开发測試群組);
|
|
|
//lessonBase = baseblobDownload.Content.ToObjectFromJson<LessonBase>();
|
|
|
}
|
|
|
//await _dingDing.SendBotMsg($"课例记录文件base.json:{lessonBase.ToJsonString()}", GroupNames.成都开发測試群組);
|
|
@@ -1344,7 +1593,7 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
//有上传 base.josn.
|
|
|
lessonRecord.upload = 1;
|
|
|
- // await _dingDing.SendBotMsg($"{_option.Location},课堂id:{_lessonId} 更新完成", GroupNames.醍摩豆服務運維群組);
|
|
|
+ // await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")},课堂id:{_lessonId} 更新完成", GroupNames.醍摩豆服務運維群組);
|
|
|
|
|
|
LessonService.DoAutoDeleteSchoolLessonRecord(lessonRecord, scope, client, school, tmdid, teacher, _serviceBus, _azureStorage, _configuration, _coreAPIHttpService, _dingDing, _azureRedis);
|
|
|
long? size = await _azureStorage.GetBlobContainerClient(blobname).GetBlobsSize($"records/{_lessonId}");
|
|
@@ -1362,7 +1611,7 @@ namespace TEAMModelOS.Function
|
|
|
size = size.HasValue ? size.Value : 0,
|
|
|
};
|
|
|
await client.GetContainer(Constant.TEAMModelOS, tbname).UpsertItemAsync(bloblog);
|
|
|
- //await _dingDing.SendBotMsg($"{_option.Location},课堂id:{_lessonId} blob刷新完成!", GroupNames.醍摩豆服務運維群組);
|
|
|
+ //await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")},课堂id:{_lessonId} blob刷新完成!", GroupNames.醍摩豆服務運維群組);
|
|
|
|
|
|
await BlobService.RefreshBlobRoot(new BlobRefreshMessage { progress = "update", root = "records", name = $"{blobname}" }, _serviceBus, _configuration, _azureRedis);
|
|
|
msgs.Add(update);
|
|
@@ -2081,7 +2330,7 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"IES5,{_option.Location},Imei AF error\n{ex.Message}\n{ex.StackTrace}{json.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"IES5,{Environment.GetEnvironmentVariable("Option:Location")},Imei AF error\n{ex.Message}\n{ex.StackTrace}{json.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
finally
|
|
|
{
|