MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / sync

Function sync

src/background/sync/base.js:414–433  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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;

Callers 2

SyncStartFunction · 0.90
autoSyncFunction · 0.85

Calls 4

getSyncStateFunction · 0.90
setSyncStateFunction · 0.90
getCurrentFunction · 0.85
getServiceFunction · 0.85

Tested by

no test coverage detected