CrazyIter_Bin 3 lat temu
rodzic
commit
139d2472f4

+ 12 - 0
BlobDownload/BlobDownload.csproj

@@ -0,0 +1,12 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>net5.0</TargetFramework>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Azure.Storage.Blobs.Batch" Version="12.6.0" />
+  </ItemGroup>
+
+</Project>

+ 60 - 0
BlobDownload/Program.cs

@@ -0,0 +1,60 @@
+using Azure.Storage.Blobs;
+using Azure.Storage.Blobs.Models;
+using Azure.Storage.Blobs.Specialized;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BlobDownload
+{
+   public class Program
+    {
+        static async Task Main(string[] args)
+        {
+            string StorageAccountConnectionString = "DefaultEndpointsProtocol=https;AccountName=teammodelstorage;AccountKey=Yq7D4dE6cFuer2d2UZIccTA/i0c3sJ/6ITc8tNOyW+K5f+/lWw9GCos3Mxhj47PyWQgDL8YbVD63B9XcGtrMxQ==;EndpointSuffix=core.chinacloudapi.cn";
+            BlobServiceClient blobServiceClient = new BlobServiceClient(StorageAccountConnectionString);
+            BlobContainerClient blobContainerClient = new BlobContainerClient(StorageAccountConnectionString, "hbcn");
+            //BlobClient blob = blobContainerClient.GetBlobClient("res/PRD-20191015001/index.json");
+            //await blob.DownloadToAsync(@"D:\VisualStudioProjects\TEAMModelOS\BlobDownload\download\index.json");
+            string downloadpath = "F:/download";
+            HashSet<string> pathset = new HashSet<string>();
+            List<string> items = new List<string>();
+            int count = 0;
+            await  foreach (BlobItem item in blobContainerClient.GetBlobsAsync(BlobTraits.None, BlobStates.None, "res/PRD-20191015002"))
+            {
+                string path = Path.Combine(downloadpath, item.Name);
+                var paths= path.Split("/");
+                StringBuilder stringBuilder = new StringBuilder();
+                for (int i = 0; i < paths.Length-1; i++) {
+                    stringBuilder.Append($"{paths[i]}/");
+
+                }
+                pathset.Add(stringBuilder.ToString());
+                count++;
+                items.Add(item.Name);
+            }
+
+            foreach (var path in pathset) {
+                if (!Directory.Exists(path)) {
+                    Directory.CreateDirectory(path);
+                }
+            }
+            List<Task> tasks = new List<Task>();
+            long  start= DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
+            foreach (var item in items)
+            {
+                BlobClient blob = blobContainerClient.GetBlobClient(item);
+
+                string path = Path.Combine(downloadpath, item);
+               
+                tasks.Add(blob.DownloadToAsync(path));
+            }
+            await Task.WhenAll(tasks);
+            long end = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
+            Console.WriteLine($"文件个数:{count};下载时间:{end-start}毫秒");
+        }
+    }
+}

Plik diff jest za duży
+ 1 - 0
BlobDownload/download/index.json


+ 17 - 7
TEAMModelFunction/ActivityHttpTrigger.cs

@@ -83,7 +83,8 @@ namespace TEAMModelFunction
                                     scope = course.scope,
                                     school = course.school,
                                     creatorId = course.creatorId,
-                                    pk = "StuCourse"
+                                    pk = "StuCourse",
+                                    createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
                                 };
                                 await client.GetContainer("TEAMModelOS", "Student").UpsertItemAsync(stuCourse, new PartitionKey(stuCourse.code));
                             }
@@ -98,7 +99,8 @@ namespace TEAMModelFunction
                                     scope = course.scope,
                                     //school = courseChange.school,
                                     creatorId = course.creatorId,
-                                    pk = "StuCourse"
+                                    pk = "StuCourse",
+                                    createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
                                 };
                                 await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync(tmdCourse, new PartitionKey(tmdCourse.code));
                             }
@@ -171,7 +173,9 @@ namespace TEAMModelFunction
                                 creatorId = info.creatorId,
                                 subjects = sub,
                                 blob = null,
-                                owner = info.owner
+                                owner = info.owner,
+                                createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                                taskStatus = -1
 
                             });
                         });
@@ -194,7 +198,9 @@ namespace TEAMModelFunction
                                 creatorId = info.creatorId,
                                 subjects = sub,
                                 blob=null,
-                                owner = info.owner
+                                owner = info.owner,
+                                createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                                taskStatus = -1
                             });
                         });
                     }
@@ -266,7 +272,9 @@ namespace TEAMModelFunction
                                 creatorId = info.creatorId,
                                 subjects = new List<string>() { "" },
                                 blob = null,
-                                owner = info.owner
+                                owner = info.owner,
+                                createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                                taskStatus = -1
 
                             });
                         });
@@ -360,8 +368,10 @@ namespace TEAMModelFunction
                                 creatorId = info.creatorId,
                                 subjects = new List<string>() { "" },
                                 blob = info.blob,
-                                owner=info.owner
-                                
+                                owner=info.owner,
+                                createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                                taskStatus = -1
+
                             });
                         });
                     }

+ 8 - 4
TEAMModelFunction/CourseServiceBus.cs

@@ -68,7 +68,8 @@ namespace TEAMModelFunction
                                     school = courseChange.school,
                                     creatorId = courseChange.creatorId,
                                     classId= new List<string> { cls},
-                                    pk = "StuCourse"
+                                    pk = "StuCourse",
+                                    createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
                                 };
                                 await client.GetContainer("TEAMModelOS", "Student").CreateItemAsync(course, new PartitionKey(course.code));
                             }
@@ -99,7 +100,8 @@ namespace TEAMModelFunction
                                     school = courseChange.school,
                                     creatorId = courseChange.creatorId,
                                     classId = new List<string> { cls },
-                                    pk = "StuCourse"
+                                    pk = "StuCourse",
+                                    createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
                                 };
                                 await client.GetContainer("TEAMModelOS", "Teacher").CreateItemAsync(course, new PartitionKey(course.code));
                             }
@@ -135,7 +137,8 @@ namespace TEAMModelFunction
                                     school = courseChange.school,
                                     creatorId = courseChange.creatorId,
                                     stulist = new List<string> { list },
-                                    pk = "StuCourse"
+                                    pk = "StuCourse",
+                                    createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
                                 };
                                 await client.GetContainer("TEAMModelOS", "Student").CreateItemAsync(course, new PartitionKey(course.code));
                             }
@@ -167,7 +170,8 @@ namespace TEAMModelFunction
                                     school = courseChange.school,
                                     creatorId = courseChange.creatorId,
                                     stulist = new List<string> { list },
-                                    pk = "StuCourse"
+                                    pk = "StuCourse",
+                                    createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
                                 };
                                 await client.GetContainer("TEAMModelOS", "Teacher").CreateItemAsync(course, new PartitionKey(course.code));
                             }

+ 6 - 3
TEAMModelFunction/TriggerCorrect.cs

@@ -106,7 +106,8 @@ namespace TEAMModelFunction
                                             qu = marker.qu,
                                             //模块术
                                             model = sub.model,
-                                            type = 1
+                                            type = 1,
+                                            createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
                                         };
                                         await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync<CorrectTask>(task, new Azure.Cosmos.PartitionKey(task.code));
                                     }
@@ -144,7 +145,8 @@ namespace TEAMModelFunction
                                             endTime = correct.endTime,
                                             //模块术
                                             model = sub.model,
-                                            type = 2
+                                            type = 2,
+                                            createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
                                         };
                                         await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync<CorrectTask>(task, new Azure.Cosmos.PartitionKey(task.code));
                                     }
@@ -184,7 +186,8 @@ namespace TEAMModelFunction
                                             endTime = correct.endTime,
                                             //模块术
                                             model = sub.model,
-                                            type = 3
+                                            type = 3,
+                                            createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
                                         };
                                         await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync<CorrectTask>(task, new Azure.Cosmos.PartitionKey(task.code));
                                     }

+ 7 - 3
TEAMModelFunction/TriggerExam.cs

@@ -118,9 +118,11 @@ namespace TEAMModelFunction
                                         creatorId = info.creatorId,
                                         subjects = sub,
                                         blob = null,
-                                        owner = info.owner
+                                        owner = info.owner,
+                                        createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                                        taskStatus = -1
 
-                                    });
+                                    });;
                                 });
                             }
                             if (studentss.IsNotEmpty())
@@ -142,7 +144,9 @@ namespace TEAMModelFunction
                                         creatorId = info.creatorId,
                                         subjects = sub,
                                         blob = null,
-                                        owner = info.owner
+                                        owner = info.owner,
+                                        createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                                        taskStatus = -1
                                     });
                                 });
                             }

+ 6 - 2
TEAMModelFunction/TriggerSurvey.cs

@@ -99,7 +99,9 @@ namespace TEAMModelFunction
                                         creatorId = survey.creatorId,
                                         subjects = new List<string> { "" },
                                         blob = survey.blob,
-                                        owner = survey.owner
+                                        owner = survey.owner,
+                                        createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                                        taskStatus = -1
 
                                     });
                                 });
@@ -122,7 +124,9 @@ namespace TEAMModelFunction
                                         creatorId = survey.creatorId,
                                         subjects = new List<string> { "" },
                                         blob = survey.blob,
-                                        owner = survey.owner
+                                        owner = survey.owner,
+                                        createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                                        taskStatus = -1
                                     });
                                 });
                             }

+ 6 - 2
TEAMModelFunction/TriggerVote.cs

@@ -105,7 +105,9 @@ namespace TEAMModelFunction
                                         creatorId = vote.creatorId,
                                         subjects = new List<string> { "" },
                                         blob = null,
-                                        owner = vote.owner
+                                        owner = vote.owner,
+                                        createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                                        taskStatus = -1
                                     });
                                 });
                             }
@@ -127,7 +129,9 @@ namespace TEAMModelFunction
                                         creatorId = vote.creatorId,
                                         subjects = new List<string> { "" },
                                         blob = null,
-                                        owner = vote.owner
+                                        owner = vote.owner,
+                                        createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                                        taskStatus = -1
                                     });
                                 });
                             }

+ 6 - 1
TEAMModelOS.SDK/Models/Cosmos/Common/StuActivity.cs

@@ -56,6 +56,11 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
         public List<string> subjects { get; set; }
         public string blob { get; set; }
         public string recordUrl { get; set; }
-        
+        public long createTime { get; set; }= DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
+        /// <summary>
+        /// 任务完成状态,-1 未参与,0,未完成, 已完成
+        /// </summary>
+        public int taskStatus { get; set; } = -1;
+
     }
 }

+ 2 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/StuCourse.cs

@@ -37,5 +37,7 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
         /// 自定义名单
         /// </summary>
         public List<string> stulist { get; set; } = new List<string>();
+        public long createTime { get; set; } = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
+
     }
 }

+ 1 - 0
TEAMModelOS.SDK/Models/Cosmos/Teacher/CorrectTask.cs

@@ -45,5 +45,6 @@ namespace TEAMModelOS.SDK.Models
         public int type { get; set; }
         //模块数
         public int model { get; set; }
+        public long createTime { get; set; } = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
     }
 }

+ 10 - 4
TEAMModelOS.SDK/Models/Service/StuListService.cs

@@ -83,7 +83,9 @@ namespace TEAMModelFunction
                             startTime = activity.startTime,
                             endTime = activity.endTime,
                             blob = activity.blob,
-                            owner = activity.owner
+                            owner = activity.owner,
+                            createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                            taskStatus = -1
                         };
                         await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-StuListService-FixActivity\n名单发生变更 新建活动中间表\n{stucourse.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                         await client.GetContainer("TEAMModelOS", "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
@@ -105,7 +107,9 @@ namespace TEAMModelFunction
                             startTime = activity.startTime,
                             endTime = activity.endTime,
                             blob = activity.blob,
-                            owner = activity.owner
+                            owner = activity.owner,
+                            createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                            taskStatus = -1
                         }; 
                         await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-StuListService-FixActivity\n名单发生变更 新建活动中间表\n{stucourse.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                         await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
@@ -179,7 +183,8 @@ namespace TEAMModelFunction
                         school = course.school,
                         creatorId = course.creatorId,
                         pk = "StuCourse",
-                        stulist = new List<string> { stuListChange.listid }
+                        stulist = new List<string> { stuListChange.listid },
+                        createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
                     };
                     await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-StuListService-FixStuCourse\n名单发生变更 新建课程中间表\n{stucourse.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                     await client.GetContainer("TEAMModelOS", "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
@@ -197,7 +202,8 @@ namespace TEAMModelFunction
                         school = course.school,
                         creatorId = course.creatorId,
                         pk = "StuCourse",
-                        stulist= new List<string> { stuListChange .listid}
+                        stulist= new List<string> { stuListChange .listid},
+                        createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
                     };
                     await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-StuListService-FixStuCourse\n名单发生变更 新建课程中间表\n{stucourse.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                     await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));

+ 6 - 2
TEAMModelOS.SDK/Models/Service/TriggerStuActivity.cs

@@ -51,7 +51,9 @@ namespace TEAMModelFunction
                             startTime = activity.startTime,
                             endTime = activity.endTime,
                             blob = activity.blob,
-                            owner = activity.owner
+                            owner = activity.owner,
+                            createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                            taskStatus = -1
                         };
                         await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
                     }
@@ -75,7 +77,9 @@ namespace TEAMModelFunction
                             startTime = activity.startTime,
                             endTime = activity.endTime,
                             blob = activity.blob,
-                            owner = activity.owner
+                            owner = activity.owner,
+                            createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                            taskStatus = -1
                         };
                         await client.GetContainer("TEAMModelOS", "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
                     }

+ 1 - 1
TEAMModelOS.SDK/TEAMModelOS.SDK.csproj

@@ -16,7 +16,7 @@
     <PackageReference Include="Azure.Identity" Version="1.4.0" />
     <PackageReference Include="Azure.Messaging.ServiceBus" Version="7.1.1" />
     <PackageReference Include="Azure.Security.KeyVault.Secrets" Version="4.1.0" />
-    <PackageReference Include="Azure.Storage.Blobs.Batch" Version="12.5.1" />
+    <PackageReference Include="Azure.Storage.Blobs.Batch" Version="12.6.0" />
     <PackageReference Include="Azure.Storage.Queues" Version="12.6.1" />
     <PackageReference Include="ClouDASLibx" Version="1.2.7" />
     <PackageReference Include="DocumentFormat.OpenXml" Version="2.12.3" />

+ 6 - 0
TEAMModelOS.sln

@@ -15,6 +15,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TEAMModelAPI", "TEAMModelAP
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client", "Client\Client.csproj", "{E1A7F6EA-319E-4582-A800-A04DEB8284D9}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlobDownload", "BlobDownload\BlobDownload.csproj", "{4869FD86-3A59-49D4-B2C9-01D370F10F32}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -45,6 +47,10 @@ Global
 		{E1A7F6EA-319E-4582-A800-A04DEB8284D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{E1A7F6EA-319E-4582-A800-A04DEB8284D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{E1A7F6EA-319E-4582-A800-A04DEB8284D9}.Release|Any CPU.Build.0 = Release|Any CPU
+		{4869FD86-3A59-49D4-B2C9-01D370F10F32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{4869FD86-3A59-49D4-B2C9-01D370F10F32}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{4869FD86-3A59-49D4-B2C9-01D370F10F32}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{4869FD86-3A59-49D4-B2C9-01D370F10F32}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 2 - 53
TEAMModelOS/Controllers/Core/BlobController.cs

@@ -324,58 +324,7 @@ namespace TEAMModelOS.Controllers.Core
                 return Ok(new { bloblogs = bloblogs });
             }
         }
-        /// <summary>
-        /// 测试单个文本内容的上传
-        /// {"containerName":"hbcn","uploadSize":5000,"optUrls":[{"url":"video/37Z888piCvm9.mp4","size":0},{}]}
-        /// </summary>
-        /// <param name="azureBlobSASDto"></param>
-        /// <returns></returns>
-        [HttpPost("update-blobsize")]
-        public async Task<ActionResult> updateBlobsSize(JsonElement request)
-        {
-            request.TryGetProperty("containerName", out JsonElement containerName);
-            request.TryGetProperty("optUrls", out JsonElement optUrls);
-            var name = containerName.GetString();
-            var urls = optUrls.ToObject<List<OptUrl>>();
-            var client = _azureStorage.GetBlobContainerClient(name);
-            var disSize = urls.Select(x => x.size).Sum();
-            RedisValue value = default;
-            long blobSize = 0;
-            value = _azureRedis.GetRedisClient(8).HashGet($"Blob:Record", name);
-            if (value != default && !value.IsNullOrEmpty)
-            {
-                JsonElement record = value.ToString().ToObject<JsonElement>();
-                if (record.TryGetInt64(out blobSize))
-                {
-                }
-            }
-            long? useSize = blobSize + disSize;
-            await _azureRedis.GetRedisClient(8).HashSetAsync($"Blob:Record", name, useSize);
-            Dictionary<string, double?> catalog = new Dictionary<string, double?>();
-            HashSet<string> root = new HashSet<string>();
-            foreach (var x in urls)
-            {
-                string[] uls = System.Web.HttpUtility.UrlDecode(x.url, Encoding.UTF8).Split("/");
-                if (uls != null)
-                {
-                    string u = !string.IsNullOrEmpty(uls[0]) ? uls[0] : uls[1];
-                    root.Add(u);
-
-                    await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Blob:Catalog:{name}", u, x.size);
-                    catalog[u] = await _azureRedis.GetRedisClient(8).SortedSetScoreAsync($"Blob:Catalog:{name}", u);
-                    if (catalog[u] < 0)
-                    {
-                        await _azureRedis.GetRedisClient(8).SortedSetRemoveAsync($"Blob:Catalog:{name}", u);
-                        catalog[u] = 0;
-                    }
-                }
-            }
-            var messageBlob = new ServiceBusMessage(new { id = Guid.NewGuid().ToString(), progress = "update", root = root.ToArray(), name = name }.ToJsonString()); ;
-            messageBlob.ApplicationProperties.Add("name", "Blob");
-            var ActiveTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
-            await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageBlob);
-            return Ok(new { size = useSize, catalog });
-        }
+      
         /// <summary>
         /// 重命名
         /// {"scope":"school","cntr":"hbcn","id":"bbf24ca7-487e-4196-8c99-b2c418a2d1b1","newName":"video/核能1.mp4"}
@@ -660,7 +609,7 @@ namespace TEAMModelOS.Controllers.Core
         /// <summary>
         /// 删除多个Url,只会在内容模块使用该接口
         /// 
-        /// {"cntr":"","urls":["res/test/1.json","res/test/2.json"]}
+        /// 
         /// {"scope":"school","cntr":"hbcn","blobs":[{"path":"other/test/1.json","id":"c107069d-4553-46c2-8c81-b3e6b4599393"},{"path":"res/test","id":"09d59b87-68c0-45fa-8221-9931a4190a2f"}]}
         /// </summary>
         /// <param name="request"></param>

+ 1 - 1
TEAMModelOS/Controllers/School/CorrectController.cs

@@ -79,7 +79,7 @@ namespace TEAMModelOS.Controllers
                 }
                 return Ok(new { tasks = tasks });
             }
-            catch (Exception ex)
+            catch (CosmosException ex)
             {
                 await _dingDing.SendBotMsg($"OS,{_option.Location},common/Correct/find-task()\n{ex.Message}{ex.StackTrace}", GroupNames.醍摩豆服務運維群組);
                 return Ok(new { tasks = tasks });