Skip to content

Scheduled Sync

Reference for Conflux's automatic sync scheduling — the sync:dispatch Artisan command and the two scheduler entries that run it across all active connections.

Command: sync:dispatch

php artisan sync:dispatch [--full]

Queries every SystemConnection with an active status, then dispatches one BulkSyncJob per connection that has at least one pull-in domain.

Option Default Effect
--full absent Dispatches BulkSyncJob with forceFull: true; triggers reconciliation on completion
(absent) Dispatches BulkSyncJob with forceFull: false; uses the delta cursor, skips reconciliation

The command is driver-agnostic: it queries SystemConnection directly and works across all integration drivers (WooCommerce, PrestaShop). Which data domains a connection syncs is not read from its System alone — it is the intersection of three things, via SystemConnection::pullInCapabilities():

  1. the capabilities the connection's System declares,
  2. the connector-widget opt-in in configuration.data_types, when the connection carries one, and
  3. the data_domains of active SyncRules naming that connection as source.

A connection is skipped entirely — silently, with no error — when that intersection is empty: no linked System, an empty opt-in, or no active outgoing rule all end the same way. See Sync Rules for where those rules come from. The command always exits 0 (success) regardless of how many jobs were dispatched.

Scheduler Entries

Two entries in routes/console.php fire the command on a configurable cron schedule:

Entry Default schedule Mode
sync:dispatch Every 2 hours (0 */2 * * *) Delta
sync:dispatch --full 06:00 and 18:00 (0 6,18 * * *) Full

Both schedules are controlled by the sync config file and can be overridden via environment variables.

Configuration

File: config/sync.php

Key Env variable Default Description
sync.delta_cron SYNC_DELTA_CRON 0 */2 * * * Cron expression for delta syncs
sync.full_cron SYNC_FULL_CRON 0 6,18 * * * Cron expression for full syncs

Set these in .env to override the defaults without touching the config file:

SYNC_DELTA_CRON="*/30 * * * *"   # every 30 minutes
SYNC_FULL_CRON="0 3 * * *"       # once daily at 03:00

Duplicate-Dispatch Safety

BulkSyncJob implements ShouldBeUnique keyed on system_connection_id. If a sync for a given connection is already queued or running when the scheduler fires again, the duplicate dispatch is a no-op. No double-processing occurs.

Sync Modes

Delta sync (default, no --full flag)
Passes the cursor from the last completed SyncBatch to the integration as ExportRequest::$modifiedAfter. The integration returns only records modified since that point. Reconciliation is not run. See Delta Sync for the cursor derivation logic.
Full sync (--full flag)
Passes modifiedAfter = null, causing the integration to return all records. On completion, ReconcileSyncJob is dispatched to soft-delete records no longer present on the source platform. See Sync Batch Reconciliation for reconciliation details.