No rate limiting saves
This commit is contained in:
parent
2a6d824cc9
commit
3d285b0b6e
3 changed files with 15 additions and 54 deletions
|
|
@ -14,7 +14,6 @@ export interface SyncSettings {
|
|||
diffCacheSizeMB: number;
|
||||
enableTelemetry: boolean;
|
||||
networkRetryIntervalMs: number;
|
||||
minimumSaveIntervalMs: number;
|
||||
}
|
||||
|
||||
export const DEFAULT_SETTINGS: SyncSettings = {
|
||||
|
|
@ -29,7 +28,6 @@ export const DEFAULT_SETTINGS: SyncSettings = {
|
|||
diffCacheSizeMB: 4,
|
||||
enableTelemetry: false,
|
||||
networkRetryIntervalMs: 1000,
|
||||
minimumSaveIntervalMs: 1000
|
||||
};
|
||||
|
||||
export class Settings {
|
||||
|
|
|
|||
|
|
@ -150,10 +150,6 @@ export class SyncClient {
|
|||
}
|
||||
);
|
||||
|
||||
const rateLimitedSave = rateLimit(
|
||||
persistence.save,
|
||||
() => settings.getSettings().minimumSaveIntervalMs
|
||||
);
|
||||
|
||||
const syncEventQueue = new SyncEventQueue(
|
||||
settings,
|
||||
|
|
@ -161,7 +157,7 @@ export class SyncClient {
|
|||
state.database,
|
||||
async (data): Promise<void> => {
|
||||
state = { ...state, database: data };
|
||||
await rateLimitedSave(state);
|
||||
await persistence.save(state);
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue