-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from Overmuse/SR/health_check
SR/health check
- Loading branch information
Showing
6 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use super::last::get_last_price; | ||
use crate::redis::Redis; | ||
use warp::Rejection; | ||
|
||
#[tracing::instrument(skip(redis))] | ||
pub async fn health_check(redis: Redis) -> Result<impl warp::Reply, Rejection> { | ||
get_last_price("AAPL".to_string(), redis).await?; | ||
Ok(warp::reply()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod aggregates; | ||
pub mod dividends; | ||
pub mod health; | ||
pub mod last; | ||
pub mod splits; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use crate::handlers; | ||
use crate::redis::with_redis; | ||
use crate::Redis; | ||
use warp::Filter; | ||
|
||
pub fn health_check( | ||
redis: Redis, | ||
) -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone { | ||
warp::path!("health_check") | ||
.and(warp::get()) | ||
.and(with_redis(redis)) | ||
.and_then(handlers::health::health_check) | ||
} | ||
|
||
pub fn health_routes( | ||
redis: Redis, | ||
) -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone { | ||
health_check(redis) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters