1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2026-10-18 09:04:42 +00:00

resolves #47: jobs don't refresh on jobs page

The computed list of filtered jobs wasn't updated when a notification
was received from the server. Switch to using a method rather than a
computed property to fix this. Also add tags to jobs reported in
job_started and job_completed notifications
This commit is contained in:
Oliver Giles
2018-08-24 13:10:00 +03:00
parent 8bcce4d5cc
commit 2349791676
3 changed files with 29 additions and 20 deletions

View File

@@ -678,6 +678,11 @@ bool Laminar::tryStartRun(std::shared_ptr<Run> run, int queueIndex) {
.fetch<uint>([&](uint etc){
j.set("etc", time(nullptr) + etc);
});
j.startArray("tags");
for(const str& t: jobTags[run->name]) {
j.String(t.c_str());
}
j.EndArray();
j.EndObject();
const char* msg = j.str();
for(LaminarClient* c : clients) {
@@ -779,6 +784,11 @@ void Laminar::runFinished(Run * r) {
.set("started", r->startedAt)
.set("result", to_string(r->result))
.set("reason", r->reason());
j.startArray("tags");
for(const str& t: jobTags[r->name]) {
j.String(t.c_str());
}
j.EndArray();
j.startArray("artifacts");
populateArtifacts(j, r->name, r->build);
j.EndArray();