Skip to main content

mr plugin scheduled-downloads

List the one-shot downloads a plugin deferred with mah.download.submit. A deferred download is stored durably, with a scheduled Job of Kind deferred-download, until its due time queues that Job. Pending rows have not been marked submitted by the scheduler yet (once the due time has come, the Job can already be running); submitted rows carry the jobId of the Job they queued; failed and cancelled rows are terminal. Cancelling the Job before it starts cancels its row; retrying it afterwards downloads now, as an ordinary download the row does not track.

Every row fires under the plugin name that submitted it, so a restart does not turn it into an unrestricted host download. It also fires as the user who submitted it and is re-validated at fire time. If that user is deleted before a pending row fires, the row becomes owned: false and stops rather than falling back to an administrator. Submitted, failed and cancelled rows keep their terminal status even if their owner is later deleted.

Naming a plugin the server does not have returns an empty list rather than an error.

Usage​

mr plugin scheduled-downloads <name>

Positional arguments:

  • <name>

Examples​

What a plugin has deferred

mr plugin scheduled-downloads my-plugin

Just pending URLs and their due times

mr plugin scheduled-downloads my-plugin --json | jq -r '.[] | select(.status=="pending") | "\(.dueAt) \(.url)"'

Flags​

This command has no local flags.

Inherited global flags​

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Output​

Array of scheduled download objects with id, pluginName, url, dueAt, status, jobId, lastError, attempts, owned, createdAt, updatedAt and claimedAt while a scheduler tick holds the submit claim, in JSON mode; a table in human mode whose STATE column reports stopped (no owner) for ownerless pending rows that can no longer fire

Exit Codes​

0 on success; 1 on any error

See Also​