Transfers: Suggested Change in RC API

Currently, when using the rclone rc core/transferred API, rclone returns the last 100 completed transfers.

This is not a particularly useful approach for an API. What I'd really like to know is: "Which transfers have completed since I last polled rclone?" This is far more useful because:

  1. I don't have to worry about setting a polling interval too short that I'm wasting CPU or too long that I "drop" transfers because rclone exceeds the limit.

  2. I don't have to constantly de-dupe the results to ignore transfers I already saw the last time I called the API.

  3. rclone won't run out of RAM because it will still prune completed transfers after each call I make—the new approach could be placed behind a flag so that the user knows they're opting-into a contract: "call to get transfer information periodically or rclone will eventually seize on large operations."

I do see where pruneTransfers() is implemented and where the 100 limit is set, but I can't figure out where the core/transferred RC command is handled to actually get the completed transfers. (I was attempting to put together a PR for the feature.)

Feel free to submit a PR.

You may be looking for this:

I found it by searching for “core/transferred” in VS Code with “files to include” set to “**/*.go”.

Hoping it is the right place, I haven’t verified/debugged.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.