mirror of
https://github.com/aljazceru/blastr.git
synced 2026-01-04 14:54:28 +01:00
Rename fetch() to more descriptive name
This commit is contained in:
@@ -59,7 +59,7 @@ pub async fn main(req: Request, env: Env, _ctx: Context) -> Result<Response> {
|
|||||||
{
|
{
|
||||||
Some(_) => {
|
Some(_) => {
|
||||||
console_log!("event already published: {}", event.id);
|
console_log!("event already published: {}", event.id);
|
||||||
return fetch();
|
return empty_response();
|
||||||
}
|
}
|
||||||
None => {}
|
None => {}
|
||||||
};
|
};
|
||||||
@@ -107,7 +107,7 @@ pub async fn main(req: Request, env: Env, _ctx: Context) -> Result<Response> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch()
|
empty_response()
|
||||||
})
|
})
|
||||||
.get("/", |_, ctx| {
|
.get("/", |_, ctx| {
|
||||||
// For websocket compatibility
|
// For websocket compatibility
|
||||||
@@ -195,7 +195,7 @@ pub async fn main(req: Request, env: Env, _ctx: Context) -> Result<Response> {
|
|||||||
});
|
});
|
||||||
Response::from_websocket(pair.client)
|
Response::from_websocket(pair.client)
|
||||||
})
|
})
|
||||||
.options("/*catchall", |_, _| fetch())
|
.options("/*catchall", |_, _| empty_response())
|
||||||
.run(req, env)
|
.run(req, env)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
@@ -236,7 +236,7 @@ pub fn queue_number(batch_name: &str) -> Result<u32> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fetch() -> worker::Result<Response> {
|
fn empty_response() -> worker::Result<Response> {
|
||||||
Response::empty()?.with_cors(&cors())
|
Response::empty()?.with_cors(&cors())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user