(
enabled: boolean,
options?: { persist?: boolean }
)
| 2959 | } |
| 2960 | |
| 2961 | async setAutoRetryEnabled( |
| 2962 | enabled: boolean, |
| 2963 | options?: { persist?: boolean } |
| 2964 | ): Promise<{ previousEnabled: boolean; enabled: boolean }> { |
| 2965 | this.assertNotDisposed("setAutoRetryEnabled"); |
| 2966 | assert(typeof enabled === "boolean", "setAutoRetryEnabled requires a boolean"); |
| 2967 | |
| 2968 | const previousEnabled = await this.loadAutoRetryEnabledPreference(); |
| 2969 | |
| 2970 | this.retryManager.setEnabled(enabled); |
| 2971 | if (!enabled) { |
| 2972 | this.retryManager.cancel(); |
| 2973 | } |
| 2974 | |
| 2975 | if (options?.persist ?? true) { |
| 2976 | await this.persistAutoRetryEnabledPreference(enabled); |
| 2977 | } |
| 2978 | |
| 2979 | return { previousEnabled, enabled }; |
| 2980 | } |
| 2981 | |
| 2982 | setAutoCompactionThreshold(threshold: number): void { |
| 2983 | this.assertNotDisposed("setAutoCompactionThreshold"); |
no test coverage detected