mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:56:31 +00:00
throttle reimplemented
This commit is contained in:
@@ -187,7 +187,7 @@ public partial class App
|
||||
|
||||
services.ConfigureSection<InferenceClientConfig>(context.Configuration);
|
||||
services.ConfigureSection<GpsDeniedClientConfig>(context.Configuration);
|
||||
services.AddSingleton<IInferenceClient, InferenceClient>();
|
||||
services.AddSingleton<IInferenceClient>(_inferenceClient);
|
||||
services.AddSingleton<IGpsMatcherClient, GpsMatcherClient>();
|
||||
services.AddSingleton<IInferenceService, InferenceService>();
|
||||
services.AddSingleton<IGpsMatcherService, GpsMatcherService>();
|
||||
@@ -238,7 +238,7 @@ public partial class App
|
||||
{
|
||||
var args = (KeyEventArgs)e;
|
||||
var keyEvent = new KeyEvent(sender, args, _formState.ActiveWindow);
|
||||
_ = ThrottleExt.Throttle(() => _mediator.Publish(keyEvent), TimeSpan.FromMilliseconds(50));
|
||||
ThrottleExt.Throttle(() => _mediator.Publish(keyEvent), KeyPressTaskId, TimeSpan.FromMilliseconds(50));
|
||||
}
|
||||
|
||||
protected override async void OnExit(ExitEventArgs e)
|
||||
|
||||
@@ -8,7 +8,6 @@ using Azaion.Common.DTO;
|
||||
using Azaion.Common.DTO.Config;
|
||||
using Azaion.Common.Extensions;
|
||||
using Azaion.Common.Services;
|
||||
using Azaion.CommonSecurity;
|
||||
using Azaion.CommonSecurity.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
@@ -130,13 +129,14 @@ public partial class MainSuite
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private async Task SaveUserSettings()
|
||||
{
|
||||
await ThrottleExt.Throttle(() =>
|
||||
ThrottleExt.Throttle(() =>
|
||||
{
|
||||
_configUpdater.Save(_appConfig);
|
||||
return Task.CompletedTask;
|
||||
}, TimeSpan.FromSeconds(2));
|
||||
}, SaveConfigTaskId, TimeSpan.FromSeconds(2));
|
||||
}
|
||||
|
||||
private void OnFormClosed(object? sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user