Skip to content

Commit 9732186

Browse files
committed
Log HQ version when starting the server or the worker
1 parent 8d42758 commit 9732186

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

crates/hyperqueue/src/bin/hq.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,18 @@ async fn main() -> hyperqueue::Result<()> {
467467
reset_sigpipe();
468468
}
469469

470+
let is_long_running = matches!(
471+
top_opts.subcmd,
472+
SubCommand::Server(ServerOpts {
473+
subcmd: ServerCommand::Start(_),
474+
}) | SubCommand::Worker(WorkerOpts {
475+
subcmd: WorkerCommand::Start(_),
476+
})
477+
);
478+
if is_long_running {
479+
log::info!("HyperQueue {HQ_VERSION}");
480+
}
481+
470482
let result = match top_opts.subcmd {
471483
SubCommand::Server(opts) => command_server(&gsettings, opts).await,
472484
SubCommand::Worker(opts) => match opts.subcmd {

crates/hyperqueue/src/worker/bootstrap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub async fn initialize_worker(
8989
server_directory: &Path,
9090
configuration: WorkerConfiguration,
9191
) -> anyhow::Result<InitializedWorker> {
92-
log::info!("Starting hyperqueue worker {}", crate::HQ_VERSION);
92+
log::info!("Starting hyperqueue worker");
9393
let server_dir = ServerDir::open(server_directory).context("Cannot load server directory")?;
9494
let record = server_dir.read_worker_access_record().with_context(|| {
9595
format!(

0 commit comments

Comments
 (0)