2

I have a small rocket application which has some get Controller.

One time a request took far too long and when I looked into the logs it was the time between getting the GET request and matching it with a controller:

Hear are the log entries:

>[2020-02-24][16:11:30][rocket::rocket][INFO] GET /check_sequence/AGV2 application/json:
>[2020-02-24][16:16:28][_][INFO] Matched: GET /check_sequence/<agv_id> (check_sequence)

You can see that it started at 16:11:30 and matched at 16:16:28.

That are five minutes apart. I have only 5 controllers with which he could try to match.

here is the code for the controller:

#[get("/check_sequence/<agv_id>")]
pub fn check_sequence(agv_id: String) ->  Result<Json<AgvResponse>,Status> {
    let database_connection = database_connection_factory::get_connection();
    return calc_route_for_sequence(&database_connection, agv_id);
}

this is the rocket code in my main (i removed all routes apart from the sequence_check):

rocket::ignite().mount("/", routes![check_sequence]).launch();

Does somebody had the same error or know where the problem could be? And is it possible to see more logs from rocket so i could pin point the error my self?

MaxV
  • 2,601
  • 3
  • 18
  • 25
  • 1
    Hi there! Without code, it's near impossible to tell what the error might be. So it would be useful if you could [edit] your question to provide the code. Furthermore, please try pasting the log output without the `[32m` color information stuff -- it's really hard to read otherwise. Lastly, you are aware that the first log concerns a request to `/check_sequence/AGV2` while the second one concerns a request to `/check_sequence`? So these things might be completely unrelated. – Lukas Kalbertodt Feb 25 '20 at 07:45
  • somehow it didnt show the logs correctly. I think now i fixxed it. I hope now you can see that they are the same call. First you see /check_sequence/AGV2 and after the the controller which matches the url "/check_sequence/". The is a placeholder for an parameter, which is "AGV2" in this case. – Waldemar Link Feb 25 '20 at 08:14
  • Hi there! You can try to configure loglevel to Debug in Rocket.toml: https://api.rocket.rs/v0.3/rocket/config/index.html#rockettoml – MaxV Feb 25 '20 at 18:12
  • Tank you for your response MaxV! I also found this configuration and tried it out. But Until now i didnt see a change in the logs. I use also the logging crate fern for my own loggings. Could it be that they are interfering and because of that i dont see more logs from rocket? With the loglevel set to debug i get the same messages as without setting the level. – Waldemar Link Feb 26 '20 at 16:25

0 Answers0