Skip to content

Commit

Permalink
dont show cache loading message on result loading
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbr committed Sep 26, 2024
1 parent c5db0ef commit cfda958
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/qlever-petrimaps/GeomCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@ double GeomCache::getLoadStatusPercent(bool total) {
case _LoadStatusStages::FromFile:
totalPercent = _curRow / static_cast<double>(_totalSize) * 100.0;
break;

case _LoadStatusStages::Finished:
totalPercent = 0;
break;
}

return std::min(100.0, totalPercent);
Expand Down Expand Up @@ -1411,5 +1415,7 @@ std::string GeomCache::load(const std::string &cacheDir) {
}

_ready = true;
_loadStatusStage = Finished;

return _indexHash;
}
2 changes: 1 addition & 1 deletion src/qlever-petrimaps/GeomCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class GeomCache {
std::atomic<size_t> _curIdRow;
size_t _curUniqueGeom;

enum _LoadStatusStages { Parse = 1, ParseIds, FromFile };
enum _LoadStatusStages { Parse = 1, ParseIds, FromFile, Finished };
_LoadStatusStages _loadStatusStage = Parse;

static size_t writeCb(void* contents, size_t size, size_t nmemb, void* userp);
Expand Down
2 changes: 1 addition & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<div id='stats'></div>
</main>
<div id='msg'>
<div id='msg-heading'>Loading results from QLever</div>
<div id='msg-heading'>Loading results...</div>
<div id='msg-info'>
<div id='msg-info-heading'></div>
<div id='msg-info-desc'></div>
Expand Down
9 changes: 9 additions & 0 deletions web/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,25 @@ function updateLoad(stage, percent, totalProgress, currentProgress) {
infoHeadingElem.innerHTML = "Filling the geometry cache";
infoDescElem.innerHTML = "This needs to be done only once for each new version of the dataset and does not have to be repeated for subsequent queries.";
stageElem.innerHTML = `Parsing ${currentProgress}/${totalProgress} geometries... (1/2)`;
document.getElementById("load-status").style.display = "grid";
break;
case 2:
infoHeadingElem.innerHTML = "Filling the geometry cache";
infoDescElem.innerHTML = "This needs to be done only once for each new version of the dataset and does not have to be repeated for subsequent queries.";
stageElem.innerHTML = `Fetching ${currentProgress}/${totalProgress} geometries... (2/2)`;
document.getElementById("load-status").style.display = "grid";
break;
case 3:
infoHeadingElem.innerHTML = "Reading cached geometries from disk";
infoDescElem.innerHTML = "This needs to be done only once after the server has been started and does not have to be repeated for subsequent queries.";
stageElem.innerHTML = `Reading ${currentProgress}/${totalProgress} geometries from disk... (1/1)`;
document.getElementById("load-status").style.display = "grid";
break;
case 4:
infoHeadingElem.innerHTML = "Fetching query result...";
infoDescElem.innerHTML = "";
stageElem.innerHTML = "";
document.getElementById("load-status").style.display = "none";
break;
}
barElem.style.width = percent + "%";
Expand Down
2 changes: 1 addition & 1 deletion web/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ h1, #msg-heading {
}

#load-status {
display: grid;
display: none;
width: 100%;
background-color: white;

Expand Down

0 comments on commit cfda958

Please sign in to comment.