Download src/shared/services/initializeCloudSync.ts from automindy/fiemwl: direct link, hf CLI and curl.
- Browser
- Download file 972 Bytes
-
https://huggingface.co/spaces/automindy/fiemwl/resolve/main/src/shared/services/initializeCloudSync.ts
- Command line
-
hf download hf://spaces/automindy/fiemwl/src/shared/services/initializeCloudSync.ts
-
curl -L -o initializeCloudSync.ts https://huggingface.co/spaces/automindy/fiemwl/resolve/main/src/shared/services/initializeCloudSync.ts
972 Bytes
| 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; | |