Claudio Yanes
2022-03-04 7e0f2e44497adeade4aa5a99da897be29cb49016
refs
author Claudio Yanes <me@claudio4.com>
Friday, March 4, 2022 02:25 +0000
committer Claudio Yanes <me@claudio4.com>
Friday, March 4, 2022 02:25 +0000
commit7e0f2e44497adeade4aa5a99da897be29cb49016
tree 3fc1109a9dcb090eaeaa82dd1f0d72dcac21dfa9 tree | zip | gz
parent 1313bd9779c638f09b8901f8432d6bc39910bce3 view | diff
Fix fetchData

The fetchData function suffer from a race condition. If the function is
called before the promise finishes, it will result in another pair of
HTTP request. This does not only make the function useless but
Actually, it makes it harmful as the data might be redownloaded twice.

Now fetchData is not a function but rather the promise by itself.
Previous callers are expected to await the variable instead, this
should be not concern as awaiting a promise multiple time in
JavaScript is completely safe.
7 files modified
42 ■■■■■ changed files
.github/workflows/deploy.yaml 2 ●●● diff | view | raw | blame | history
.gitignore 4 ●●●● diff | view | raw | blame | history
assets/js/graph.js 2 ●●● diff | view | raw | blame | history
assets/js/popover.js 2 ●●● diff | view | raw | blame | history
assets/js/search.js 2 ●●● diff | view | raw | blame | history
layouts/partials/backlinks.html 4 ●●●● diff | view | raw | blame | history
layouts/partials/head.html 26 ●●●●● diff | view | raw | blame | history