Update worker-rs
This commit is contained in:
12
src/db/cf.rs
12
src/db/cf.rs
@@ -116,20 +116,14 @@ impl DBClient for CFClient {
|
||||
Ok(())
|
||||
}
|
||||
async fn get_client(&self, client_id: String) -> Result<Option<ClientEntry>> {
|
||||
let entry = self
|
||||
Ok(self
|
||||
.ctx
|
||||
.kv(KV_NAMESPACE)
|
||||
.map_err(|e| anyhow!("Failed to get KV store: {}", e))?
|
||||
.get(&format!("{}/{}", KV_CLIENT_PREFIX, client_id))
|
||||
.json()
|
||||
.await
|
||||
.map_err(|e| anyhow!("Failed to get KV: {}", e))?
|
||||
.map(|e| e.as_string());
|
||||
if let Some(e) = entry {
|
||||
Ok(serde_json::from_str(&e)
|
||||
.map_err(|e| anyhow!("Failed to deserialize client entry: {}", e))?)
|
||||
} else {
|
||||
Ok(None)
|
||||
}
|
||||
.map_err(|e| anyhow!("Failed to get KV: {}", e))?)
|
||||
}
|
||||
async fn set_code(&self, code: String, code_entry: CodeEntry) -> Result<()> {
|
||||
let namespace = self
|
||||
|
||||
@@ -9,10 +9,9 @@ pub mod oidc;
|
||||
mod worker_lib;
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
use worker_lib::main as worker_main;
|
||||
// pub use worker_lib::main;
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[event(fetch)]
|
||||
pub async fn main(req: Request, env: Env) -> Result<Response> {
|
||||
pub async fn main(req: Request, env: Env, _ctx: worker::Context) -> Result<Response> {
|
||||
worker_main(req, env).await
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ async fn resolve_name(eth_provider: Option<Url>, address: H160) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
async fn resolve_avatar(eth_provider: Option<Url>, address: H160) -> Option<Url> {
|
||||
async fn resolve_avatar(_eth_provider: Option<Url>, _address: H160) -> Option<Url> {
|
||||
None
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user