diff --git a/README.md b/README.md index 31f41fc..cb18955 100644 --- a/README.md +++ b/README.md @@ -60,9 +60,9 @@ For a compiled binary, follow the [sample entrypoint](apps/web/backend/src/entry `splitting: true`. This keeps the temporary cron process from loading the server modules. It asks the running app to process due syncs, waits for completion, and exits. -Use `sync.providers` to connect accounts. Create a destination with `sync.api.createDestination()`, -then link a source to it with `sync.api.createInstallation()`. Supply their `config` values, -a provider `connection` when needed, and `intervalMs` for the sync schedule. Pass the acting user's +Use `sync.providers` to connect accounts, then create a sync with `sync.api.createSync()`. +Supply the source `definition`, its `config`, the `destination`, and a provider `connection` +when needed. All enabled syncs poll on the shared cron schedule. Pass the acting user's `actorId` and data owner's `ownerId` from your host's authentication. See the [sample host](apps/web/backend/src/main.ts), diff --git a/apps/web/backend/src/services/dashboard/service.ts b/apps/web/backend/src/services/dashboard/service.ts index 0790683..1800b4f 100644 --- a/apps/web/backend/src/services/dashboard/service.ts +++ b/apps/web/backend/src/services/dashboard/service.ts @@ -4,7 +4,6 @@ import type { JsonObject } from '@context-use/open-sync/json'; import { BadRequestError } from '#backend/lib/errors.ts'; -const pollIntervalMs = 900_000; export type CreateSync = { source: string; config?: JsonObject; @@ -53,7 +52,6 @@ export class DashboardService { destination: input.destination, config, connection, - intervalMs: pollIntervalMs, enabled: !definition.provider || !!connection, }); // Authorization may finish in another tab between the status check and persistence. diff --git a/apps/web/frontend/src/routes/_workspace/syncs.$id.tsx b/apps/web/frontend/src/routes/_workspace/syncs.$id.tsx index 5c24168..26289f2 100644 --- a/apps/web/frontend/src/routes/_workspace/syncs.$id.tsx +++ b/apps/web/frontend/src/routes/_workspace/syncs.$id.tsx @@ -16,7 +16,6 @@ import { import { SyncAccount } from './-syncs/sync-account'; import { PendingDeliverables, PollHistory, ReceivedDeliverables } from './-syncs/sync-activity'; -const millisecondsPerMinute = 60_000; export const Route = createFileRoute('/_workspace/syncs/$id')({ validateSearch: ( search: Record, @@ -145,10 +144,6 @@ function SyncDetail() {
Status
{sync.status.replaceAll('_', ' ')}
-
Sync interval
-
{sync.intervalMs / millisecondsPerMinute} minutes
-
Next scheduled run
-
{nextRun(sync)}