2471: Remove the connection keep-alive timeout r=MarinPostma a=Thearas

# Pull Request

## What does this PR do?
Fixes <https://github.com/meilisearch/meilisearch-go/issues/221>.
Meilisearch has a default connection keep-alive timeout for 5s, which means it will close the connections with idle time >= 5s.
This PR set actix-web keep-alive config to `KeepAlive::Os`, let the client and system to decide when to close the connection.

## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?


Co-authored-by: Thearas <thearas850@gmail.com>
This commit is contained in:
bors[bot] 2022-06-08 06:59:25 +00:00 committed by GitHub
commit 09ec8e9fca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
use std::env; use std::env;
use std::sync::Arc; use std::sync::Arc;
use actix_web::http::KeepAlive;
use actix_web::HttpServer; use actix_web::HttpServer;
use clap::Parser; use clap::Parser;
use meilisearch_auth::AuthController; use meilisearch_auth::AuthController;
@ -83,7 +84,8 @@ async fn run_http(
) )
}) })
// Disable signals allows the server to terminate immediately when a user enter CTRL-C // Disable signals allows the server to terminate immediately when a user enter CTRL-C
.disable_signals(); .disable_signals()
.keep_alive(KeepAlive::Os);
if let Some(config) = opt.get_ssl_config()? { if let Some(config) = opt.get_ssl_config()? {
http_server http_server