(implementation: Implementation, { backendName, authStore, config }: BackendOptions)
| 368 | backupSync: AsyncLock; |
| 369 | |
| 370 | constructor(implementation: Implementation, { backendName, authStore, config }: BackendOptions) { |
| 371 | // We can't reliably run this on exit, so we do cleanup on load. |
| 372 | this.deleteAnonymousBackup(); |
| 373 | this.config = config; |
| 374 | this.implementation = implementation.init(this.config, { |
| 375 | useWorkflow: selectUseWorkflow(this.config), |
| 376 | updateUserCredentials: this.updateUserCredentials, |
| 377 | initialWorkflowStatus: status.first(), |
| 378 | }); |
| 379 | this.backendName = backendName; |
| 380 | this.authStore = authStore; |
| 381 | if (this.implementation === null) { |
| 382 | throw new Error('Cannot instantiate a Backend with no implementation'); |
| 383 | } |
| 384 | this.backupSync = asyncLock(); |
| 385 | } |
| 386 | |
| 387 | async status() { |
| 388 | const attempts = 3; |
nothing calls this directly
no test coverage detected