We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sqlx reported an error when I used the script to loop the request Here's my code
#[derive(Serialize)] struct JsonResp { id: i32 } #[derive(Clone)] struct AppState { pub pool: MySqlPool } #[async_std::main] async fn main() -> tide::Result<()> { let pool = MySqlPoolOptions::new() .max_connections(5) .connect("mysql://root:123456@localhost:3306/blog").await?; println!("{:?}", pool); let app_state = AppState { pool: pool }; let mut app = tide::with_state(app_state); app.at("/test").get(test); app.listen("127.0.0.1:8080").await?; Ok(()) } async fn test(req: Request<(AppState)>) -> tide::Result<tide::Body> { println!("order_shoes"); let app_state = req.state(); let pool = &app_state.pool; println!("{:?}", pool); let (id, color) = sqlx::query_as::<_, (i32, String)>("select id, color from tags where id = 1").fetch_one(pool).await?; println!("{}", color); Ok(tide::Body::from_json( &JsonResp { id: id})?) }
require 'net/http' require 'uri' loop do url = URI.parse("http://localhost:8080/test") response = Net::HTTP.get(url) p response end
for i in {1..20}; do nohup ruby ruby_send.rb > send.log & done
Run the start.shell and There was no response to the request
The text was updated successfully, but these errors were encountered:
If there are only 5 connections and you loop fast enough sqlx will timeout waiting for a connection to be freed.
Either increase number of connections or increase timeout.
Sorry, something went wrong.
@MrZhouYj please try your test against the latest master to see if #1149 fixed the problem, or try 0.5.2 when it's deployed.
master
0.5.2
@MrZhouYj please try to reproduce with sqlx 0.5.2
sqlx 0.5.2
Looks okay, thanks
No branches or pull requests
Sqlx reported an error when I used the script to loop the request
Here's my code
rust main.rs
test script
ruby_send.rb
start.shell
Run the start.shell and There was no response to the request
The text was updated successfully, but these errors were encountered: