mirror of
https://github.com/13hannes11/ics-proxy.git
synced 2024-09-06 08:01:41 +02:00
fix blocking code in asynch
This commit is contained in:
1271
Cargo.lock
generated
1271
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
FROM rust:1.61 as builder
|
FROM rust:1.72 as builder
|
||||||
RUN apt-get update && apt-get install -y sqlite3 && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y sqlite3 && rm -rf /var/lib/apt/lists/*
|
||||||
WORKDIR /usr/src/ics-proxy
|
WORKDIR /usr/src/ics-proxy
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ async fn make_ics_request(req: HttpRequest, db_pool: web::Data<Pool<Sqlite>>) ->
|
|||||||
|
|
||||||
match Uuid::parse_str(id) {
|
match Uuid::parse_str(id) {
|
||||||
Ok(uuid) => match Link::find_by_uuid(uuid.to_string(), db_pool).await {
|
Ok(uuid) => match Link::find_by_uuid(uuid.to_string(), db_pool).await {
|
||||||
Ok(link) => match reqwest::blocking::get(link.destination) {
|
Ok(link) => match reqwest::get(link.destination).await {
|
||||||
Ok(r) => match r.text() {
|
Ok(r) => match r.text().await {
|
||||||
Ok(res) => HttpResponse::Ok().content_type("text/calendar").body(res),
|
Ok(res) => HttpResponse::Ok().content_type("text/calendar").body(res),
|
||||||
Err(err) => HttpResponse::Ok()
|
Err(err) => HttpResponse::Ok()
|
||||||
.status(StatusCode::INTERNAL_SERVER_ERROR)
|
.status(StatusCode::INTERNAL_SERVER_ERROR)
|
||||||
|
|||||||
Reference in New Issue
Block a user