-
Notifications
You must be signed in to change notification settings - Fork 34
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
[#5228] Quota use django signals instead of irods microservice and AVUs #5461
[#5228] Quota use django signals instead of irods microservice and AVUs #5461
Conversation
if not quota_user == user: | ||
continue | ||
aggregate_size += res.size | ||
return aggregate_size | ||
|
||
|
||
def update_quota_usage(username): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved this to hs_core.tasks
operations = [ | ||
migrations.AddField( | ||
model_name='baseresource', | ||
name='quota_holder', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
store the quota_holder on the resource model (was previously stored in AVU)
@receiver(post_copy_resource) | ||
@receiver(post_version_resource) | ||
@receiver(post_publish_resource) | ||
def hs_update_quota(sender, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use signals to asyc update the stored quota sizes
|
||
|
||
class Command(BaseCommand): | ||
help = "Migrate quota_holder info from irods AVU into Django UserQuota model." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
command to migrate the quota_holder metadata from irods AVU into django resource model
659eb72
to
ab295e8
Compare
Looks like I have a test failing
I'm guessing it has to do with a race condition because the test passes when run locally. |
I believe this django signals work will be replaced by #5469 |
closing in favor of #5469 |
This PR alters are quota system to remove reliance on the iRods microservices.
More info is available in
https://github.com/hydroshare/hydroshare/blob/5228-remove-irods-quota-avus/quota-info.md
This PR attempts to "capture" all relevant file operations using Django signals.
Each signal triggers an asynchronous call to
update_quota_usage
Resolves #5228 in conjunction with #5229
Relies on #5443 in order to get accurate file sizes from irods storage
Resolves #5418 by entirely removing the need for irods microservice in the dataZone
Resolves #5235 because removing the irods microservice will vastly improve performance of filesystem operations
Resolves #5441 because quota will be refreshed before sending emails and we can be confident in correct values
Resolves #5384 because we don't need a microservice anymore
Resolves #5195 because we don't need a microservice anymore
Resolves #5286 because we don't need a microservice anymore
Pull Request Checklist:
Positive Test Case