Skip to content

Commit

Permalink
Fixes duration-parse in trade view. (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
silathdiir authored Sep 2, 2021
1 parent cf25a26 commit 7abc269
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ futures-channel = "0.3.13"
futures-core = { version = "0.3.13", default-features = false }
futures-util = { version = "0.3.13", default-features = false }
hex = "0.4.3"
humantime = "2.1.0"
humantime-serde = "1.0.1"
hyper = "0.14.4"
itertools = "0.10.0"
Expand Down
4 changes: 2 additions & 2 deletions src/openapi/tradingview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::restapi::errors::RpcError;
use crate::restapi::types::{KlineReq, KlineResult, TickerResult};
use crate::restapi::{mock, state};
use actix_web::Responder;
use humantime::parse_duration;
use paperclip::actix::web::{self, HttpRequest, Json};
use paperclip::actix::{api_v2_operation, Apiv2Schema};
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -381,8 +382,7 @@ pub async fn ticker(
app_state: web::Data<state::AppState>,
) -> Result<Json<TickerResult>, actix_web::Error> {
let (ticker_inv, market_name) = path.into_inner();
let ticker_inv: TickerInv = serde_json::from_str(&ticker_inv).unwrap();
let ticker_inv = ticker_inv.0;
let ticker_inv = parse_duration(&ticker_inv).unwrap();

let cache = req.app_data::<state::AppCache>().expect("App cache not found");
let now_ts: DateTime<Utc> = SystemTime::now().into();
Expand Down

0 comments on commit 7abc269

Please sign in to comment.