()
| 412 | return pluginScript.list(); |
| 413 | }, |
| 414 | async sync() { |
| 415 | try { |
| 416 | await this.prepare(); |
| 417 | } catch { |
| 418 | // Sync in progress, ignore |
| 419 | } |
| 420 | if (getSyncState().status !== SYNC_AUTHORIZED || getCurrent() !== this.name) |
| 421 | return; |
| 422 | setSyncState({ status: SYNC_IN_PROGRESS }); |
| 423 | try { |
| 424 | await this._sync(); |
| 425 | logInfo('Sync finished:', this.displayName); |
| 426 | } catch (err) { |
| 427 | setSyncState({ status: SYNC_ERROR }); |
| 428 | logInfo('Failed syncing:', this.displayName); |
| 429 | this.logError(err); |
| 430 | throw err; |
| 431 | } |
| 432 | setSyncState({ status: SYNC_AUTHORIZED }); |
| 433 | }, |
| 434 | async _sync() { |
| 435 | const currentSyncMode = syncMode; |
| 436 | syncMode = SYNC_MERGE; |
no test coverage detected