Code optimization, function asynchrony

This commit is contained in:
2dust
2024-10-22 17:50:42 +08:00
parent 3bf2dc711d
commit b3c2084b76
10 changed files with 28 additions and 31 deletions
@@ -14,9 +14,14 @@ namespace ServiceLib.Handler
public ProfileExHandler()
{
Init();
}
private async Task Init()
{
await InitData();
Task.Run(async () =>
{
await Init();
while (true)
{
await SaveQueueIndexIds();
@@ -25,7 +30,7 @@ namespace ServiceLib.Handler
});
}
private async Task Init()
private async Task InitData()
{
await SQLiteHelper.Instance.ExecuteAsync($"delete from ProfileExItem where indexId not in ( select indexId from ProfileItem )");