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

Improve update_attachment_storage_bytes management command #896

Merged
merged 3 commits into from Oct 3, 2023

Conversation

noliveleger
Copy link
Contributor

@noliveleger noliveleger commented Sep 28, 2023

Description

Return a more accurate global storage metric when user has no projects

Additional info

Add three new options to management command:

  • force to recalculate counters for every user - even those already calculated
  • sync to recalculate all the counters of users whose profile does not correspond with the projects
  • skip-lock-release to avoid release submission locks (useful (and faster) when all locks are already released)

@noliveleger noliveleger marked this pull request as ready for review September 29, 2023 12:52
Copy link
Contributor

@LMNTL LMNTL left a comment

Choose a reason for hiding this comment

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

Making a note based on some discussion that came up during review but is outside of this PR's scope:
UserProfile.attachment_storage_bytes doesn't get updated when an item goes into the Trash Bin - currently, it gets updated whenever the XForm is actually deleted. This means that it disagrees with the storage amount returned by /service_usage/, which doesn't include trashed forms.

@LMNTL LMNTL merged commit a7cd7ba into release/2.023.37 Oct 3, 2023
1 check passed
@LMNTL LMNTL deleted the improve-storage-counter-mgnt-cmd branch October 3, 2023 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants