mirror of
https://github.com/unraid/api.git
synced 2026-02-04 23:19:04 -06:00
fix: debounce is too long (#1426)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Reduced the delay before configuration changes are processed, resulting in faster response times to configuration updates throughout the application. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -42,8 +42,7 @@ export class PluginNameConfigPersister implements OnModuleInit {
|
||||
}
|
||||
|
||||
// Automatically persist changes to the config file after a short delay.
|
||||
const HALF_SECOND = 500;
|
||||
this.configService.changes$.pipe(debounceTime(HALF_SECOND)).subscribe({
|
||||
this.configService.changes$.pipe(debounceTime(25)).subscribe({
|
||||
next: ({ newValue, oldValue, path: changedPath }) => {
|
||||
// Only persist if the change is within this plugin's config namespace
|
||||
if (changedPath.startsWith("plugin-name.") && newValue !== oldValue) {
|
||||
|
||||
Reference in New Issue
Block a user