MCPcopy Index your code
hub / github.com/Microck/opencode-studio / triggerGitHubAutoSync

Function triggerGitHubAutoSync

server/index.js:2245–2261  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2243}
2244
2245function triggerGitHubAutoSync() {
2246 const studio = loadStudioConfig();
2247 if (!studio.githubAutoSync) return;
2248
2249 if (autoSyncTimer) clearTimeout(autoSyncTimer);
2250
2251 console.log('[AutoSync] Change detected, scheduling GitHub backup in 15s...');
2252 autoSyncTimer = setTimeout(async () => {
2253 console.log('[AutoSync] Starting GitHub backup...');
2254 try {
2255 const result = await performGitHubBackup();
2256 console.log(`[AutoSync] Backup completed: ${result.message || 'Pushed to GitHub'}`);
2257 } catch (err) {
2258 console.error('[AutoSync] Backup failed:', err.message);
2259 }
2260 }, 15000); // 15s debounce
2261}
2262
2263app.get('/api/github/backup/status', async (req, res) => {
2264 try {

Callers 2

index.jsFile · 0.85
startServerFunction · 0.85

Calls 2

loadStudioConfigFunction · 0.85
performGitHubBackupFunction · 0.85

Tested by

no test coverage detected