1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2026-11-02 00:29:32 +00:00

expose lResult and lLastResult

This commit is contained in:
Oliver Giles
2015-09-19 10:31:51 +02:00
parent a2701dcfd9
commit 2147346493
3 changed files with 10 additions and 1 deletions

View File

@@ -425,6 +425,12 @@ void Laminar::assignNewJobs() {
run->startedAt = time(0);
run->build = ++buildNums[run->name];
run->laminarHome = homeDir;
// set the last known result if exists
db->stmt("SELECT result FROM builds WHERE name = ? ORDER BY completedAt DESC LIMIT 1")
.bind(run->name)
.fetch<int>([=](int result){
run->lastResult = RunState(result);
});
fs::path wd = fs::path(homeDir)/"run"/run->name/std::to_string(run->build);
if(!fs::is_directory(wd) && !fs::create_directory(wd)) {