cmd-sync-servers - v1.0.0
    Preparing search index...

    Class SyncRecordsExperimental

    The sync records of one site and server, which let the engine tell a file changed on one side from one changed on both. Kept per machine in the state folder, written atomically, and checkpointed during a run so an interrupted sync keeps what it finished. Disabled records (maintainInfo off) hold nothing and are never written.

    SyncSession keeps the records; programs rarely need them directly.

    Index
    enabled: boolean

    False when the site does not maintain synchronization information.

    file: string

    The JSON file the records are kept in.

    • get size(): number
      Experimental

      How many files have a record.

      Returns number

    • Experimental

      Saves when 50 changes or 5 seconds have gone by since the last save.

      Returns Promise<void>

    • Experimental

      Forgets the record of a path, as when it is gone on both sides.

      Parameters

      • target: string

      Returns void

    • Experimental

      The record of a site-relative path, if it has one.

      Parameters

      • target: string

      Returns SyncRecord | undefined

    • Experimental

      The most recent sync time of any file, or undefined.

      Returns number | undefined

    • Experimental

      Every path with a record.

      Returns string[]

    • Experimental

      Forgets every record and removes the file.

      Returns Promise<void>

    • Experimental

      Writes the records atomically under a lock, when anything changed since the last save.

      Returns Promise<void>

    • Experimental

      Records both sides of a path as just synchronized. Ignored when the records are disabled.

      Parameters

      Returns void

    • Experimental

      Reads the records of a site and server, or starts empty when there are none yet.

      Parameters

      • stateDir: string
      • siteId: string
      • serverId: string
      • enabled: boolean

      Returns Promise<SyncRecords>

      SyncError E_CONFIG_INVALID when the file is damaged.