|
@@ -119,7 +119,10 @@ fn fortune(req: HttpRequest<State>) -> Box<Future<Item=HttpResponse, Error=Error
|
|
|
.content_encoding(headers::ContentEncoding::Identity)
|
|
|
.body(res)?)
|
|
|
},
|
|
|
- Err(_) => Ok(httpcodes::HTTPInternalServerError.into())
|
|
|
+ Err(e) => {
|
|
|
+ println!("fortune error: {}", e);
|
|
|
+ Ok(httpcodes::HTTPInternalServerError.into())
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
.responder()
|
|
@@ -127,12 +130,7 @@ fn fortune(req: HttpRequest<State>) -> Box<Future<Item=HttpResponse, Error=Error
|
|
|
|
|
|
fn main() {
|
|
|
let sys = System::new("techempower");
|
|
|
- let dbhost = match option_env!("DBHOST") {
|
|
|
- Some(it) => it,
|
|
|
- _ => "127.0.0.1"
|
|
|
- };
|
|
|
- let db_url = format!(
|
|
|
- "postgres://benchmarkdbuser:benchmarkdbpass@{}/hello_world", dbhost);
|
|
|
+ let db_url = "postgres://benchmarkdbuser:benchmarkdbpass@TFB-database/hello_world";
|
|
|
|
|
|
// Start db executor actors
|
|
|
let addr = SyncArbiter::start(
|