AMR indiv and fungal large files uploads management#367
Draft
anagperal wants to merge 14 commits into
Draft
Conversation
…al RIS CSV files in chunks
Member
|
Task linked: CU-8699wradu BLOCKING AMR-I RIS upload error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 References
BASED ON CODE FROM #363 by @MatiasArriola
📝 Implementation
Async upload workflow — one continuous sequence
🔁 Async Uploads Workflow (AMR – Individual / AMR – Fungal)
This document describes, step by step, how the server-side async upload script imports a
primary CSV file into DHIS2. The script processes uploads that were queued in the Datastore,
validating the whole file before importing and sending the data to the server in chunks.
The entry point is the
uploadDatasetsroutine insrc/scripts/cliAsyncUploads.ts.One continuous sequence
Processing the queue
one at a time — there is no parallelism between uploads; all chunking and concurrency
happens inside a single upload.
pending. If not, it is skipped.
secondary file, and finds its module (a missing module is an error).
Preparing the file
It comes from the module's Datastore config (default 100; currently testing 300 vs 500 comming from Datastore config).
Validation pass (whole file, before anything is imported)
checks plus program-rule checks.
is saved, and the import is skipped entirely — guaranteeing the whole file is validated
before any data goes in.
Import pass (only if validation passed completely)
and side effects turned off (the rules were already checked in the validation pass),
6 at a time. The concurrency is batched: six are sent, the script waits for all six to
finish, then sends the next six.
chunks or blocks are imported — keeping whatever succeeded so far.
records were imported, their ID list is saved to a file and linked to the upload, and the
import summaries are saved.
Finishing the upload
imported.
errors), or uploaded (nothing imported) — and the upload is removed from the queue.
instead; once it reaches the maximum (3 by default), it is removed from the queue and marked
failed, otherwise it stays for a later run to retry.
The knobs, in one place
📹 Screenshots/Screen capture
🔥 Testing
transform_JPN_INDIV_2023.sh