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

fix: wait until file resource content is available #15686

Merged
merged 3 commits into from
Nov 14, 2023

Conversation

jbee
Copy link
Contributor

@jbee jbee commented Nov 14, 2023

FileResource content is stored asynchronously which makes it difficult to work with immediately after calling "save".
Therefore a sleep-waiting was added.

Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Merging #15686 (d0794b8) into tracker_importer_scheduler (4ebaa4b) will increase coverage by 0.00%.
The diff coverage is 66.66%.

Additional details and impacted files
@@                      Coverage Diff                      @@
##             tracker_importer_scheduler   #15686   +/-   ##
=============================================================
  Coverage                         66.20%   66.21%           
- Complexity                        31272    31282   +10     
=============================================================
  Files                              3483     3483           
  Lines                            129897   129911   +14     
  Branches                          15179    15182    +3     
=============================================================
+ Hits                              86002    86024   +22     
+ Misses                            36810    36807    -3     
+ Partials                           7085     7080    -5     
Flag Coverage Δ
integration 49.93% <66.66%> (+<0.01%) ⬆️
integration-h2 32.28% <0.00%> (-0.01%) ⬇️
unit 30.28% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...p/dhis/fileresource/FileResourceStorageStatus.java 100.00% <ø> (ø)
.../fileresource/JCloudsFileResourceContentStore.java 43.47% <ø> (ø)
...cated/tracker/TrackedEntityInstanceController.java 38.07% <ø> (ø)
.../webapi/controller/metadata/MetadataImportJob.java 72.00% <100.00%> (+6.00%) ⬆️
...i/controller/tracker/imports/TrackerImportJob.java 80.64% <100.00%> (ø)
.../dhis/fileresource/DefaultFileResourceService.java 54.16% <62.50%> (+0.83%) ⬆️

... and 11 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ebaa4b...d0794b8. Read the comment docs.

@@ -33,6 +33,5 @@
public enum FileResourceStorageStatus {
NONE, // No content stored
PENDING, // In transit to store, not available
FAILED, // Storing the resource failed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI: This was never used anywhere so it seemed just confusing to have

@jbee jbee requested a review from enricocolasante November 14, 2023 15:17
@jbee jbee self-assigned this Nov 14, 2023
@jbee jbee marked this pull request as ready for review November 14, 2023 15:17
@jbee jbee merged commit 014eec0 into dhis2:tracker_importer_scheduler Nov 14, 2023
13 checks passed
jbee added a commit that referenced this pull request Nov 14, 2023
* "chore: Make async tracker importer use scheduler"

This reverts commit bc2befc.

* fix: wait until file resource content is available (#15686)

* fix: wait until file resource content is available

* fix: detect null content for file resources

* fix: wait for file content to become available

---------

Co-authored-by: Jan Bernitt <[email protected]>
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.

1 participant