chore: global sync per minute safety limit (#2765)

This commit is contained in:
Karol Sójko
2024-01-11 15:26:09 +01:00
committed by GitHub
parent 3d895ca499
commit cf4b5ccf0a
11 changed files with 140 additions and 10 deletions

View File

@@ -43,16 +43,16 @@ export async function createAndInitSimpleAppContext(
}
}
export async function createAppContextWithFakeCrypto(identifier, email, password) {
return createAppContext({ identifier, crypto: new FakeWebCrypto(), email, password })
export async function createAppContextWithFakeCrypto(identifier, email, password, syncCallsThresholdPerMinute) {
return createAppContext({ identifier, crypto: new FakeWebCrypto(), email, password, syncCallsThresholdPerMinute })
}
export async function createAppContextWithRealCrypto(identifier) {
return createAppContext({ identifier, crypto: new SNWebCrypto() })
}
export async function createAppContext({ identifier, crypto, email, password, host } = {}) {
const context = new AppContext({ identifier, crypto, email, password, host })
export async function createAppContext({ identifier, crypto, email, password, host, syncCallsThresholdPerMinute } = {}) {
const context = new AppContext({ identifier, crypto, email, password, host, syncCallsThresholdPerMinute })
await context.initialize()
return context
}