From e0ccca94f9d08c5ed7e0ac4fa81a6d50db2b5c18 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Mon, 27 Mar 2023 11:38:53 -0700 Subject: [PATCH] log_message_collector: open log handle to ensure log file exists This fixes the test in the previous commit. --- ofborg/src/tasks/log_message_collector.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ofborg/src/tasks/log_message_collector.rs b/ofborg/src/tasks/log_message_collector.rs index 64f7b8e..8cc4a95 100644 --- a/ofborg/src/tasks/log_message_collector.rs +++ b/ofborg/src/tasks/log_message_collector.rs @@ -215,6 +215,11 @@ impl worker::SimpleWorker for LogMessageCollector { MsgType::Start(ref start) => { self.write_metadata(&job.from, start) .expect("failed to write metadata"); + + // Make sure the log content exists by opening its handle. + // This (hopefully) prevents builds that produce no output (for any reason) from + // having their logs.nix.ci link complaining about a 404. + let _ = self.handle_for(&job.from).unwrap(); } MsgType::Msg(ref message) => { let handle = self.handle_for(&job.from).unwrap();