This commit is contained in:
2025-06-04 14:17:32 +07:00
parent 4c953f7efb
commit 5beb66f11a
257 changed files with 72800 additions and 2 deletions

View File

@ -0,0 +1,49 @@
using ManagementApp.AServices.Microsoft365;
using ManagementApp.AServices.ThreadManage;
using Microsoft.Identity.Web;
using System.Collections.Concurrent;
namespace ManagementApp.AServices
{
public class Microsoft365Service : BackgroundService, IDisposable
{
private readonly IConcurrentTasks _task;
public Microsoft365Service(IConcurrentTasks tasks) {
_task = tasks;
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
await DoWork(stoppingToken);
}
private async Task DoWork(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
var workItem = await _task.First(stoppingToken);
try
{
await workItem(stoppingToken);
}
catch (Exception ex)
{
}
}
}
public override async Task StopAsync(CancellationToken stoppingToken)
{
await base.StopAsync(stoppingToken);
}
public override void Dispose()
{
throw new NotImplementedException();
}
}
}