mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 00:27:21 +00:00
Upgraded to .NET 10 (#1147)
This commit is contained in:
1 parent
faae2951f7
commit
fc7399e81b
327 files changed
+3059
-3049
No files matched your search
@@ -549,12 +549,22 @@ public sealed partial class DataSourceEmbeddingService(SettingsManager settingsM
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
public override Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
// Changes to the embedding settings which do not pass through the queue, cf. ProcessMessage:
|
||||
//
|
||||
// Changes to the embedding settings which do not pass through the queue, cf. ProcessMessage.
|
||||
// We listen for them while the app starts: since .NET 10, ExecuteAsync runs as a task of its
|
||||
// own from its very first line, and a message sent before that task got its turn would go
|
||||
// unnoticed.
|
||||
//
|
||||
MessageBus.INSTANCE.RegisterComponent(this);
|
||||
this.ApplyFilters([], [Event.PLUGINS_RELOADED, Event.CONFIGURATION_CHANGED]);
|
||||
|
||||
return base.StartAsync(cancellationToken);
|
||||
}
|
||||
|
||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
await this.WaitForInitialSettingsAndBootstrapAsync(stoppingToken);
|
||||
|
||||
while (!stoppingToken.IsCancellationRequested)
|
||||
|
||||
@@ -27,12 +27,9 @@ public partial class RustService
|
||||
// Read events line by line:
|
||||
using var reader = new StreamReader(stream);
|
||||
|
||||
// Read until the end of the stream or cancellation:
|
||||
while(!reader.EndOfStream && !stopToken.IsCancellationRequested)
|
||||
// Read the next line of JSON until the end of the stream or cancellation:
|
||||
while(!stopToken.IsCancellationRequested && await reader.ReadLineAsync(stopToken) is { } line)
|
||||
{
|
||||
// Read the next line of JSON from the stream:
|
||||
var line = await reader.ReadLineAsync(stopToken);
|
||||
|
||||
// Skip empty lines:
|
||||
if (string.IsNullOrWhiteSpace(line))
|
||||
continue;
|
||||
|
||||
@@ -352,9 +352,8 @@ public sealed partial class RustService
|
||||
await using var stream = await response.Content.ReadAsStreamAsync(token);
|
||||
using var reader = new StreamReader(stream);
|
||||
|
||||
while (!reader.EndOfStream && !token.IsCancellationRequested)
|
||||
while (!token.IsCancellationRequested && await reader.ReadLineAsync(token) is { } line)
|
||||
{
|
||||
var line = await reader.ReadLineAsync(token);
|
||||
if (string.IsNullOrWhiteSpace(line))
|
||||
continue;
|
||||
|
||||
|
||||
Reference in new issue
Block a user