Type alias MultiServerUploadOptions<TServer, TUpload>

MultiServerUploadOptions<TServer, TUpload>: UploadOptions<TServer, TUpload> & {
    mirrorTimeout?: number;
    onError?: ((server, sha256, blob, error) => void);
    onRejection?: ((server, sha256, blob, error) => RejectionAction | Promise<RejectionAction>);
    onStart?: ((server, sha256, blob) => void);
    onUpload?: ((server, sha256, blob) => void);
    preflight?: boolean;
}

Type Parameters

Type declaration

  • Optional mirrorTimeout?: number

    Timeout for mirror requests

    Default

    5000
    
  • Optional onError?: ((server, sha256, blob, error) => void)

    called when upload to a server fails

      • (server, sha256, blob, error): void
      • Parameters

        Returns void

  • Optional onRejection?: ((server, sha256, blob, error) => RejectionAction | Promise<RejectionAction>)

    Called when a server rejects the upload with a known BUD-02 status (409, 413, 415, 422). Return "skip" to skip this server and continue, or "cancel" to abort the entire upload. If not provided, rejections are reported via onError.

  • Optional onStart?: ((server, sha256, blob) => void)

    called on blob when uploaded to started to a server

      • (server, sha256, blob): void
      • Parameters

        • server: TServer
        • sha256: string

          the hash of the blob being uploaded or mirrored

        • blob: TUpload

          the original blob

        Returns void

  • Optional onUpload?: ((server, sha256, blob) => void)

    called when upload to a server is complete

      • (server, sha256, blob): void
      • Parameters

        Returns void

  • Optional preflight?: boolean

    Run parallel HEAD / checks on all servers before starting uploads. Servers that already have the blob will use /mirror to register ownership instead of /upload.

    Default

    true