diff --git a/src/laminar.cpp b/src/laminar.cpp index 0d746f4..54bd7f9 100644 --- a/src/laminar.cpp +++ b/src/laminar.cpp @@ -865,6 +865,8 @@ void Laminar::runFinished(Run * r) { fsHome->remove(d); } + fsHome->symlink(kj::Path{"archive", r->name, "latest"}, std::to_string(r->build), kj::WriteMode::CREATE|kj::WriteMode::MODIFY); + // in case we freed up an executor, check the queue assignNewJobs(); } diff --git a/src/resources/js/app.js b/src/resources/js/app.js index f5eb3b8..69155f4 100644 --- a/src/resources/js/app.js +++ b/src/resources/js/app.js @@ -700,6 +700,14 @@ const Run = function() { }, methods: { status: function(data) { + // Check for the /latest endpoint. An intuitive check might be + // if(this.$route.params.number == 'latest'), but unfortunately + // after calling $router.replace, we re-enter status() before + // $route.params is updated. Instead, assume that if there is + // no 'started' field, we should redirect to the latest number + if(!('started' in data) && 'latestNum' in data) + return this.$router.replace('/jobs/' + this.$route.params.name + '/' + data.latestNum); + state.jobsRunning = []; state.job = data; state.latestNum = data.latestNum;