1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2024-10-27 20:34:20 +00:00

no badges for unfinished runs

do not attempt to generate badges for runs which have not
yet finished.

resolves 
This commit is contained in:
Oliver Giles 2020-11-13 14:02:00 +13:00
parent 579c192d89
commit 3e993d35a0

View File

@ -784,7 +784,7 @@ kj::Maybe<kj::Own<const kj::ReadableFile>> Laminar::getArtefact(std::string path
bool Laminar::handleBadgeRequest(std::string job, std::string &badge) {
RunState rs = RunState::UNKNOWN;
db->stmt("SELECT result FROM builds WHERE name = ? ORDER BY number DESC LIMIT 1")
db->stmt("SELECT result FROM builds WHERE name = ? AND result IS NOT NULL ORDER BY number DESC LIMIT 1")
.bind(job)
.fetch<int>([&](int result){
rs = RunState(result);