Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update caches on item creation #307

Merged
merged 2 commits into from
Nov 14, 2023
Merged

Update caches on item creation #307

merged 2 commits into from
Nov 14, 2023

Conversation

slifty
Copy link
Contributor

@slifty slifty commented Nov 9, 2023

This PR improves our caching logic so that we update our local caches to reflect the state of permanent upon archive record and archive folder creation. In both cases this will prevent unnecessary call to the permanent back end.

I did verify locally that this lowers the number of calls to the API by 1 for each archive record being created.

Resolves #306

We were not updating our local caches when items were created; this was
not resulting in functional issues because of our cache-busting logic,
but it was resulting in non-optimal caching and an increase in API calls
as a result of being unable to rely on the cache.

Specifically, rclone verifies files immediately after creation by
checking their stats.  This meant that every time a file was uploaded it
would result in a preventable API call to `/folder/getWithChildren`.
There were some circumstances where a similar unnecessary call could
happen after folder creation.

Issue #306 Update cache after file / folder creation
Copy link
Contributor

@nfebe nfebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Quite positive it would guard against other calls other than /folder/getWithChildren.

(Would know once I ​analyze the logs from the current test runs)

@slifty slifty merged commit 542fcfc into main Nov 14, 2023
2 checks passed
@slifty slifty deleted the 306-update-caches-on-create branch November 14, 2023 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update cache after file / folder creation
2 participants