DataFileUploadManager
Inherits:
QObject
Uploads files selected by configured data-file sets, manually or on the Spoke.Zone logging schedule.
The configuration and DataFilesApi are caller-owned and must outlive this manager. This class uploads files that already exist; it does not record traces or rotate files. Each upload scans the configured file sets, starts the first candidate immediately, and spaces successive file attempts by its interAttemptDelayMs() setting (15 seconds by default). Failed create, upload, and snapshot attempts are retried at the front of the queue up to retryCount() times after the initial attempt; upload retries reuse the record ID created for that file. Once retries are exhausted, the file is skipped for the rest of that batch and retained locally for a later batch. Files larger than the Spoke.Zone 50 MiB data-file limit are rejected before upload. Each upload uses a snapshot; the local file is removed after success only if its contents have not changed since that snapshot. Call setFileSets() while idle to replace the selected directories and patterns. It returns false while a batch or an already-issued request is still active. stop() cancels the queue and future schedule, discarding remote record IDs from the aborted batch; an already-issued request is allowed to finish, but a completed create request will not start a file upload.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
DataFileUploadManager explicit | ||
~DataFileUploadManager override | ||
bool | setFileSets | Replaces the selected directories and patterns unless a batch or issued request is still active. |
void | start | Starts automatic uploads according to the active Spoke.Zone schedule; repeated calls are ignored. |
void | stop | Stops automatic scheduling and the current queue without aborting an API request already sent. |
bool | upload | Starts a manual upload batch. |
int | retryCount const | |
void | setRetryCount | Sets the maximum retries after the initial attempt. |
int | interAttemptDelayMs const | |
void | setInterAttemptDelayMs | Sets the delay in milliseconds between attempts. |
bool | isRunning const | |
bool | isUploading const |
explicit
DataFileUploadManager
Section titled “DataFileUploadManager”override
~DataFileUploadManager
Section titled “~DataFileUploadManager”setFileSets
Section titled “setFileSets”Replaces the selected directories and patterns unless a batch or issued request is still active.
Starts automatic uploads according to the active Spoke.Zone schedule; repeated calls are ignored.
Stops automatic scheduling and the current queue without aborting an API request already sent.
upload
Section titled “upload”Starts a manual upload batch.
Returns false if a batch/request is active or no files match the configured sets.
const
retryCount
Section titled “retryCount”Returns
Section titled “Returns”The maximum retries allowed after a file’s initial attempt; defaults to 3.
setRetryCount
Section titled “setRetryCount”Sets the maximum retries after the initial attempt.
Negative values are treated as zero.
const
interAttemptDelayMs
Section titled “interAttemptDelayMs”Returns
Section titled “Returns”The delay in milliseconds between file attempts and retries; defaults to 15000.
setInterAttemptDelayMs
Section titled “setInterAttemptDelayMs”Sets the delay in milliseconds between attempts.
Negative values are treated as zero.
const
isRunning
Section titled “isRunning”Returns
Section titled “Returns”Whether automatic scheduling is enabled.
const
isUploading
Section titled “isUploading”Returns
Section titled “Returns”Whether a batch or an issued request still needs to settle.
Signals
Section titled “Signals”| Return | Name | Description |
|---|---|---|
void | uploadStarted | Emitted when a manual or scheduled batch begins. |
void | fileUploaded | Emitted when one file was uploaded successfully. |
void | fileUploadFailed | Emitted for each failed attempt; after the retry limit, the local file is retained for a later batch. |
void | fileRemovalFailed | Emitted when cloud upload succeeded but the local file could not be removed. |
void | uploadFinished | Emitted when a batch has visited every pending path. |
void | uploadCancelled | Emitted when stop() cancels the queue; an already-issued request may still emit its file result afterward. |
void | uploadScheduled | Emitted whenever the next automatic upload time is calculated. |
void | scheduleFailed | Emitted when an enabled weekly schedule is malformed and cannot be scheduled. |
uploadStarted
Section titled “uploadStarted”Emitted when a manual or scheduled batch begins.
fileUploaded
Section titled “fileUploaded”Emitted when one file was uploaded successfully.
fileUploadFailed
Section titled “fileUploadFailed”Emitted for each failed attempt; after the retry limit, the local file is retained for a later batch.
fileRemovalFailed
Section titled “fileRemovalFailed”Emitted when cloud upload succeeded but the local file could not be removed.
uploadFinished
Section titled “uploadFinished”Emitted when a batch has visited every pending path.
uploadCancelled
Section titled “uploadCancelled”Emitted when stop() cancels the queue; an already-issued request may still emit its file result afterward.
uploadScheduled
Section titled “uploadScheduled”Emitted whenever the next automatic upload time is calculated.
scheduleFailed
Section titled “scheduleFailed”Emitted when an enabled weekly schedule is malformed and cannot be scheduled.