fix: print what's getting started

This commit is contained in:
əlemi 2024-06-06 02:32:55 +02:00
parent 93666cea97
commit a3decfea95
Signed by: alemi
GPG key ID: A4895B84D311642C
3 changed files with 4 additions and 2 deletions

View file

@ -94,6 +94,7 @@ pub enum CliCommand {
} }
pub async fn run(ctx: upub::Context, command: CliCommand) -> Result<(), Box<dyn std::error::Error>> { pub async fn run(ctx: upub::Context, command: CliCommand) -> Result<(), Box<dyn std::error::Error>> {
tracing::info!("running cli task: {command:?}");
match command { match command {
CliCommand::Faker { count } => CliCommand::Faker { count } =>
Ok(faker(ctx, count as i64).await?), Ok(faker(ctx, count as i64).await?),

View file

@ -49,9 +49,9 @@ pub async fn serve(ctx: upub::Context, bind: String) -> Result<(), std::io::Erro
.mastodon_routes() // no-op if mastodon feature is disabled .mastodon_routes() // no-op if mastodon feature is disabled
.with_state(ctx); .with_state(ctx);
// run our app with hyper, listening locally on port 3000 tracing::info!("serving api routes on {bind}");
let listener = tokio::net::TcpListener::bind(bind).await?;
let listener = tokio::net::TcpListener::bind(bind).await?;
axum::serve(listener, router).await?; axum::serve(listener, router).await?;
Ok(()) Ok(())

View file

@ -13,6 +13,7 @@ pub fn spawn(
) -> tokio::task::JoinHandle<()> { ) -> tokio::task::JoinHandle<()> {
use dispatcher::JobDispatcher; use dispatcher::JobDispatcher;
tokio::spawn(async move { tokio::spawn(async move {
tracing::info!("starting worker task");
ctx.run(concurrency, poll, filter).await ctx.run(concurrency, poll, filter).await
}) })
} }