Skip to content

basalt / drives/src / dueConnections

Function: dueConnections() ​

> dueConnections(drives, options): Promise<DriveConnection[]>

Defined in: drives/src/sync.ts:453

Connections that a scheduled sweep should visit.

Exposed separately so an app can feed it to defineReconciler from @basaltkit/scheduler — which already solves overlap guarding, the cross-replica lease and per-item error isolation — rather than this package growing its own scheduler:

defineReconciler({
  name: 'drive-sync',
  every: '15m',
  find: () => dueConnections(drives, { tenantId, staleFor: '15m' }),
  redispatch: (c) => SyncDrive.dispatch({ connectionId: c.id, tenantId: c.tenantId }),
}).schedule(scheduler)

Parameters ​

drives ​

Drives

options ​

limit? ​

number

provider? ​

string

staleForMs? ​

number

tenantId ​

string

Returns ​

Promise<DriveConnection[]>

Released under the MIT License.