MCPcopy Create free account
hub / github.com/neomjs/neo / initAsync

Method initAsync

ai/services/github-workflow/SyncService.mjs:62–84  ·  view source on GitHub ↗

* @returns {Promise }

()

Source from the content-addressed store, hash-verified

60 * @returns {Promise<void>}
61 */
62 async initAsync() {
63 await super.initAsync();
64
65 if (aiConfig.syncOnStartup) {
66 try {
67 // Ensure the system is healthy before attempting a sync.
68 // This call is cached/deduplicated by HealthService, so it's cheap if the server
69 // has already checked it.
70 const health = await HealthService.healthcheck();
71
72 if (health.status === 'healthy') {
73 logger.info('[SyncService] Starting automatic startup sync...');
74 await this.runFullSync();
75 } else {
76 logger.warn('[SyncService] Skipping startup sync: GitHub CLI is unhealthy.');
77 }
78 } catch (error) {
79 // We strictly catch errors here to ensure that a sync failure (network, API, etc.)
80 // does not crash the entire service or prevent the server from starting.
81 logger.error('[SyncService] Startup sync failed:', error.message);
82 }
83 }
84 }
85
86 /**
87 * The main public entry point for the synchronization process.

Callers

nothing calls this directly

Calls 5

runFullSyncMethod · 0.95
infoMethod · 0.80
warnMethod · 0.80
errorMethod · 0.80
healthcheckMethod · 0.45

Tested by

no test coverage detected