Browse Source

code cleanup

pull/25/head
Alexey Velikiy 3 years ago
parent
commit
0041a88054
  1. 8
      server/src/api/auth.rs
  2. 13
      server/src/api/metric.rs
  3. 2
      server/src/api/mod.rs
  4. 4
      server/src/services/analytic_service/analytic_service.rs

8
server/src/api/auth.rs

@ -1,14 +1,14 @@
use hastic::services::user_service;
use warp::filters::method::post;
use warp::http::HeaderValue;
use warp::hyper::{Body, StatusCode};
use warp::{http::Response, Filter};
use warp::hyper::StatusCode;
use warp::Filter;
use warp::{Rejection, Reply};
use serde::Serialize;
use crate::api::{self, API};
use crate::api::{self};
use parking_lot::RwLock;
use std::sync::Arc;

13
server/src/api/metric.rs

@ -1,19 +1,16 @@
use hastic::services::{metric_service, user_service};
use hastic::services::metric_service;
use subbeat::metric::{Metric, MetricResult};
use warp::filters::method::get;
use warp::http::HeaderValue;
use warp::hyper::server::conn::Http;
use warp::hyper::{Body, StatusCode};
use warp::reject::Reject;
use warp::{http::Response, Filter};
use warp::{reject, Rejection, Reply};
use warp::Filter;
use warp::{Rejection, Reply};
use serde::Serialize;
use anyhow;
use crate::api::{self, API};
use crate::api::API;
use std::collections::HashMap;

2
server/src/api/mod.rs

@ -4,8 +4,8 @@ use hastic::services::{metric_service, segments_service, user_service};
use warp::http::HeaderValue;
use warp::hyper::{Body, StatusCode};
use warp::reject::Reject;
use warp::{body, options, Rejection, Reply};
use warp::{http::Response, Filter};
use warp::{options, Reply};
mod analytics;
mod auth;

4
server/src/services/analytic_service/analytic_service.rs

@ -107,7 +107,7 @@ impl AnalyticService {
))
.await
{
Ok(_) => println!("Learning starting"),
Ok(_) => {}
Err(_e) => println!("Fail to send notification about learning start"),
}
@ -145,7 +145,7 @@ impl AnalyticService {
))
.await
{
Ok(_) => println!("Learning resuls sent"),
Ok(_) => {}
Err(_e) => println!("Fail to send learning results"),
}
}

Loading…
Cancel
Save