Skip to content

Commit

Permalink
Fixes to server
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Sep 25, 2024
1 parent 6e90d5e commit ee6ce05
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/web3_account_server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
name = "web3_account_server"
license = "MIT"
repository = "https://github.com/scx1332/"
version = "0.4.9"
version = "0.4.10"

[dependencies]
actix-web = { workspace = true }
Expand Down
6 changes: 1 addition & 5 deletions crates/web3_account_server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ async fn add_to_queue(data: web::Data<AppState>, item: String) -> impl Responder
async fn count(data: web::Data<AppState>) -> impl Responder {
let _lock = data.lock.lock().unwrap();
let file_name = &data.file_name;
let results: Vec<String> = {
let file = OpenOptions::new().read(true).open(file_name).unwrap();
let reader = BufReader::new(file);
serde_json::from_reader(reader).unwrap_or_else(|_| Vec::new())
};
let results = read_results(file_name);
HttpResponse::Ok().body(results.len().to_string())
}

Expand Down

0 comments on commit ee6ce05

Please sign in to comment.