feat(sync): add sync subsystem: SyncManager, OpsServer sync handlers, Sync UI and state, provider groupFilter support, and realtime sync log streaming via TypedSocket
This commit is contained in:
@@ -2,6 +2,7 @@ import * as plugins from '../plugins.ts';
|
||||
import { logger } from '../logging.ts';
|
||||
import { ConnectionManager } from './connectionmanager.ts';
|
||||
import { ActionLog } from './actionlog.ts';
|
||||
import { SyncManager } from './syncmanager.ts';
|
||||
import { OpsServer } from '../opsserver/index.ts';
|
||||
import { StorageManager } from '../storage/index.ts';
|
||||
import { CacheDb, CacheCleaner, CachedProject, CachedSecret, SecretsScanService } from '../cache/index.ts';
|
||||
@@ -18,11 +19,14 @@ export class GitopsApp {
|
||||
public opsServer: OpsServer;
|
||||
public cacheDb: CacheDb;
|
||||
public cacheCleaner: CacheCleaner;
|
||||
public syncManager!: SyncManager;
|
||||
public secretsScanService!: SecretsScanService;
|
||||
private scanIntervalId: number | null = null;
|
||||
private paths: ReturnType<typeof resolvePaths>;
|
||||
|
||||
constructor() {
|
||||
const paths = resolvePaths();
|
||||
this.paths = paths;
|
||||
this.storageManager = new StorageManager({
|
||||
backend: 'filesystem',
|
||||
fsPath: paths.defaultStoragePath,
|
||||
@@ -51,6 +55,15 @@ export class GitopsApp {
|
||||
// Initialize connection manager (loads saved connections)
|
||||
await this.connectionManager.init();
|
||||
|
||||
// Initialize sync manager
|
||||
this.syncManager = new SyncManager(
|
||||
this.storageManager,
|
||||
this.connectionManager,
|
||||
this.actionLog,
|
||||
this.paths.syncMirrorsPath,
|
||||
);
|
||||
await this.syncManager.init();
|
||||
|
||||
// Initialize secrets scan service with 24h auto-scan
|
||||
this.secretsScanService = new SecretsScanService(this.connectionManager);
|
||||
const SCAN_INTERVAL_MS = 24 * 60 * 60 * 1000; // 24 hours
|
||||
@@ -80,6 +93,7 @@ export class GitopsApp {
|
||||
clearInterval(this.scanIntervalId);
|
||||
this.scanIntervalId = null;
|
||||
}
|
||||
await this.syncManager.stop();
|
||||
await this.opsServer.stop();
|
||||
this.cacheCleaner.stop();
|
||||
await this.cacheDb.stop();
|
||||
|
||||
Reference in New Issue
Block a user