mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-14 09:33:48 +00:00
Hardened background work against disconnected circuits (#937)
This commit is contained in:
1 parent
99089f853e
commit
f03c2d1c88
44 files changed
+500
-126
No files matched your search
@@ -39,10 +39,10 @@ public partial class Chat : MSGComponentBase
|
||||
|
||||
this.splitterPosition = this.SettingsManager.ConfigurationData.Workspace.SplitterPosition;
|
||||
this.splitterSaveTimer.AutoReset = false;
|
||||
this.splitterSaveTimer.Elapsed += async (_, _) =>
|
||||
this.splitterSaveTimer.Elapsed += (_, _) =>
|
||||
{
|
||||
this.SettingsManager.ConfigurationData.Workspace.SplitterPosition = this.splitterPosition;
|
||||
await this.SettingsManager.StoreSettings();
|
||||
this.SettingsManager.StoreSettings().Observe($"{nameof(Chat)}: storing the splitter position");
|
||||
};
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
@@ -42,7 +42,7 @@ public partial class Home : MSGComponentBase
|
||||
|
||||
// Read the last change content asynchronously
|
||||
// without blocking the UI thread:
|
||||
_ = this.ReadLastChangeAsync();
|
||||
this.ReadLastChangeAsync().Observe($"{nameof(Home)}: reading the last change");
|
||||
}
|
||||
|
||||
protected override Task OnAfterRenderAsync(bool firstRender)
|
||||
|
||||
@@ -197,7 +197,7 @@ public partial class Information : MSGComponentBase
|
||||
|
||||
// Determine the Pandoc version may take some time, so we start it here
|
||||
// without waiting for the result:
|
||||
_ = this.DeterminePandocVersion();
|
||||
this.DeterminePandocVersion().Observe($"{nameof(Information)}: determining the Pandoc version");
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -340,7 +340,7 @@ public partial class Information : MSGComponentBase
|
||||
this.vectorStoreRefreshCancellationTokenSource = new CancellationTokenSource();
|
||||
var cancellationToken = this.vectorStoreRefreshCancellationTokenSource.Token;
|
||||
|
||||
_ = Task.Run(async () =>
|
||||
Task.Run(async () =>
|
||||
{
|
||||
const int MAX_TRIES = 12;
|
||||
for (var attempt = 0; attempt < MAX_TRIES; attempt++)
|
||||
@@ -366,7 +366,7 @@ public partial class Information : MSGComponentBase
|
||||
return;
|
||||
}
|
||||
}
|
||||
}, cancellationToken);
|
||||
}, cancellationToken).Observe($"{nameof(Information)}: refreshing the vector store info");
|
||||
}
|
||||
|
||||
private IAvailablePlugin? FindManagedConfigurationPlugin(Guid configurationId)
|
||||
|
||||
@@ -93,7 +93,7 @@ public partial class Plugins : MSGComponentBase
|
||||
protected override void DisposeResources()
|
||||
{
|
||||
// Release the drop area again, so lower layers can catch dropped files:
|
||||
_ = this.MessageBus.SendMessage(this, Event.UNREGISTER_FILE_DROP_AREA, DropLayers.PAGES);
|
||||
this.MessageBus.SendMessage(this, Event.UNREGISTER_FILE_DROP_AREA, DropLayers.PAGES).Observe($"{nameof(Plugins)}: releasing the drop area");
|
||||
base.DisposeResources();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public partial class Writer : MSGComponentBase
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
this.SettingsManager.InjectSpellchecking(USER_INPUT_ATTRIBUTES);
|
||||
this.typeTimer.Elapsed += async (_, _) => await this.InvokeAsync(this.GetSuggestions);
|
||||
this.typeTimer.Elapsed += (_, _) => this.InvokeAsync(this.GetSuggestions).Observe($"{nameof(Writer)}: getting writing suggestions");
|
||||
this.typeTimer.AutoReset = false;
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
Reference in new issue
Block a user