✨ feat: add new config option to manage threads and improve logging
This commit is contained in:
parent
5b4e7c75c0
commit
d8bd2feb6e
4 changed files with 50 additions and 11 deletions
|
@ -49,6 +49,8 @@ pub fn run(listener: TcpListener, config: Config) -> std::io::Result<Server> {
|
|||
|
||||
let handlebars_ref: web::Data<Handlebars> = web::Data::new(handlebars);
|
||||
|
||||
let cloned_config_threads_opt: u8 = config.threads;
|
||||
|
||||
let server = HttpServer::new(move || {
|
||||
App::new()
|
||||
.app_data(handlebars_ref.clone())
|
||||
|
@ -70,6 +72,7 @@ pub fn run(listener: TcpListener, config: Config) -> std::io::Result<Server> {
|
|||
.service(routes::settings) // settings page
|
||||
.default_service(web::route().to(routes::not_found)) // error page
|
||||
})
|
||||
.workers(cloned_config_threads_opt as usize)
|
||||
// Start server on 127.0.0.1 with the user provided port number. for example 127.0.0.1:8080.
|
||||
.listen(listener)?
|
||||
.run();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue