Print version to log (#4226)

* Print version to log

* Keep cargofmt happy

* Keep cargo_fmt happy

* Keep Clippy happy
This commit is contained in:
Kroese 2023-12-05 17:35:59 +01:00 committed by GitHub
parent a790a24c4d
commit 203ca9d617
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,6 +49,7 @@ use lemmy_utils::{
rate_limit::RateLimitCell,
response::jsonify_plain_text_errors,
settings::{structs::Settings, SETTINGS},
version,
};
use prometheus::default_registry;
use prometheus_metrics::serve_prometheus;
@ -108,6 +109,9 @@ pub struct CmdArgs {
/// Placing the main function in lib.rs allows other crates to import it and embed Lemmy
pub async fn start_lemmy_server(args: CmdArgs) -> Result<(), LemmyError> {
// Print version number to log
println!("Lemmy v{}", version::VERSION);
// return error 503 while running db migrations and startup tasks
let mut startup_server_handle = None;
if args.http_server {
@ -133,7 +137,7 @@ pub async fn start_lemmy_server(args: CmdArgs) -> Result<(), LemmyError> {
let federation_enabled = local_site.federation_enabled;
if federation_enabled {
println!("federation enabled, host is {}", &SETTINGS.hostname);
println!("Federation enabled, host is {}", &SETTINGS.hostname);
}
check_private_instance_and_federation_enabled(&local_site)?;
@ -144,7 +148,7 @@ pub async fn start_lemmy_server(args: CmdArgs) -> Result<(), LemmyError> {
let rate_limit_cell = RateLimitCell::new(rate_limit_config);
println!(
"Starting http server at {}:{}",
"Starting HTTP server at {}:{}",
SETTINGS.bind, SETTINGS.port
);