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

Asynchronous Deletions - Allow Immediate Delete #316

Merged
merged 4 commits into from
Jan 22, 2025

Conversation

anagperal
Copy link
Contributor

@anagperal anagperal commented Jan 14, 2025

📌 References

⚠️ METADATA CHANGE:

📝 Implementation

  • Mark deletions that are under delete to "DELETING" status to allow a second run of the script while the first might be processing. The second script run will get deletions under "PENDING" status
  • Schedule the async deletions every hour --> sys admin when deployed
  • If Deletion fails, re-try upto 3 times(store in datastore https://dev.eyeseetea.com/who-dev-238/dhis-web-datastore/index.html#/edit/glass/general) and after display an error message saying Admin needs to look into it (save in upload the errorAsyncDeleting key to true)
  • Apply logic to start delete of file (synchronously) for small size files. File size should be stored in the datastore to allow configuration of the same without code changes (configured in every module in https://dev.eyeseetea.com/who-dev-238/dhis-web-datastore/index.html#/edit/glass/modules)
  • Crete a script to migrate async-deletions to new format. Run next script first when deployed:
    npx ts-node -r dotenv/config src/scripts/async_deletions_migrate_new_datastore.ts

📹 Screenshots/Screen capture

Screenshot from 2025-01-14 09-45-48

AMR - agg:

image

🔥 Testing

@ifoche
Copy link
Member

ifoche commented Jan 14, 2025

Copy link
Contributor

@9sneha-n 9sneha-n 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, thanks @anagperal

@bhavananarayanan bhavananarayanan merged commit 1200295 into development Jan 22, 2025
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.

4 participants