mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-02 13:22:11 +03:00
OmniRoute is an intelligent API gateway that unifies 20+ AI providers behind a single OpenAI-compatible endpoint. Features include intelligent routing with 6 strategies, multi-format translation (OpenAI/Claude/Gemini/Responses API), circuit breakers, semantic caching, combo fallback chains, real-time health monitoring, and a full dashboard with provider management, analytics, and CLI tool integration. Key highlights: - 20+ providers (Claude Code, Codex, Gemini CLI, GitHub Copilot, iFlow, Qwen, Kiro, etc.) - 6 routing strategies (Fill First, Round Robin, P2C, Random, Least Used, Cost Optimized) - Export/Import database backup with full archive support - Translator Playground with 4 modes (Playground, Chat Tester, Test Bench, Live Monitor) - 100% TypeScript across src/ and open-sse/ - Docker support with multi-stage builds - Comprehensive documentation and 9 dashboard screenshots
32 lines
941 B
TypeScript
32 lines
941 B
TypeScript
import { getCloudSyncScheduler } from "@/shared/services/cloudSyncScheduler";
|
|
import { isCloudEnabled, cleanupProviderConnections } from "@/lib/localDb";
|
|
|
|
/**
|
|
* Initialize cloud sync scheduler
|
|
* This should be called when the application starts
|
|
*/
|
|
export async function initializeCloudSync() {
|
|
try {
|
|
// Cleanup null fields from existing data
|
|
await cleanupProviderConnections();
|
|
|
|
// Create scheduler instance with default 15-minute interval
|
|
const scheduler = await getCloudSyncScheduler(null, 15);
|
|
|
|
// Start the scheduler
|
|
await scheduler.start();
|
|
|
|
return scheduler;
|
|
} catch (error) {
|
|
console.error("[CloudSync] Error initializing scheduler:", error);
|
|
throw error;
|
|
}
|
|
}
|
|
|
|
// For development/testing purposes
|
|
if (typeof require !== "undefined" && require.main === module) {
|
|
initializeCloudSync().catch((err) => console.error("[CloudSync] init failed:", err));
|
|
}
|
|
|
|
export default initializeCloudSync;
|