Skip to content

Commit

Permalink
订阅task运行方式调整
Browse files Browse the repository at this point in the history
  • Loading branch information
aiqinxuancai committed Jun 11, 2024
1 parent ef7a2b5 commit ed8f350
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions Aria2Fast/Service/AutoRenameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public static async Task<List<RenameModel>> GetNewNames(List<string> fileNames)
if (!string.IsNullOrEmpty(result.Response))
{
JObject root = JObject.Parse(result.Response);

List<RenameModel> objs = root.ToObject<List<RenameModel>>();
return objs;
}
Expand Down
11 changes: 10 additions & 1 deletion Aria2Fast/Service/SubscriptionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,16 @@ public void Start()
}

_tokenSource = new CancellationTokenSource();
Task.Run(() => TimerFunc(_tokenSource.Token), _tokenSource.Token);
//Task.Run(() => TimerFunc(_tokenSource.Token), _tokenSource.Token);



Task longRunningTask = Task.Factory.StartNew((object? token) =>
{
TimerFunc(_tokenSource.Token);
}, _tokenSource.Token, TaskCreationOptions.LongRunning);


}

public void Stop()
Expand Down

0 comments on commit ed8f350

Please sign in to comment.