release-engineering / ubi-population-tool

A tool for populating UBI repositories.
GNU General Public License v3.0
3 stars 14 forks source link

Fix futures chaining #215

Closed rbikar closed 1 year ago

rbikar commented 1 year ago

Previous usage of f_map caused creation of nested future and subsequent result() call didn't really wait for nested futures to finish. This caused immediate end of whole program before all submitted futures were started.

In production env likely only some of submitted cdn cache purges were allowed to start, some paths were not purged at all.

Let's now use f_flat_map instead which can be used with future-returning functions and any nesting of futures is automatically avoided - therefore the program will wait for all submitted cache purges.

rbikar commented 1 year ago

run tests

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (f441d8a) 96.89% compared to head (50e6753) 96.89%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #215 +/- ## ======================================= Coverage 96.89% 96.89% ======================================= Files 8 8 Lines 997 997 ======================================= Hits 966 966 Misses 31 31 ``` | [Impacted Files](https://app.codecov.io/gh/release-engineering/ubi-population-tool/pull/215?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=release-engineering) | Coverage Δ | | |---|---|---| | [ubipop/\_cdn.py](https://app.codecov.io/gh/release-engineering/ubi-population-tool/pull/215?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=release-engineering#diff-dWJpcG9wL19jZG4ucHk=) | `98.74% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.