Skip to content

Commit

Permalink
cleans
Browse files Browse the repository at this point in the history
  • Loading branch information
Axel-Jacobsen committed Dec 9, 2023
1 parent 796550f commit ce9c88a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
21 changes: 6 additions & 15 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use log::{info};
use log::{debug, info};

mod bots;
mod market_handler;
Expand All @@ -7,28 +7,19 @@ mod market_handler;
async fn main() {
env_logger::init();

println!("Hello, world!");
info!("Starting!");

let mut market_handler = market_handler::MarketHandler::new();

assert!(market_handler.check_alive().await);
assert!(market_handler.check_alive().await, "Manifold API is down");

let maybe_some_market = market_handler.market_search(
String::from("(M25000 subsidy!) Will a prompt that enables GPT-4 to solve easy Sudoku puzzles be found? (2023)"));

let mut rx = match maybe_some_market.await {
Ok(Some(_)) => {
let gg = market_handler.get_bet_stream("all_bets".to_string(), vec![]);
gg.await
}
Ok(None) => panic!("No markets found"),
Err(e) => panic!("{:?}", e),
};
let mut rx = market_handler
.get_bet_stream("all_bets".to_string(), vec![])
.await;

let mut i: u64 = 0;
loop {
info!("{i} {:?}", rx.recv().await);
debug!("{i} {:?}", rx.recv().await);
i += 1;
}
}
2 changes: 1 addition & 1 deletion src/market_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn get_env_key(key: &str) -> Result<String, String> {
}
}

pub async fn get_endpoint(
async fn get_endpoint(
endpoint: String,
query_params: &[(String, String)],
) -> Result<reqwest::Response, reqwest::Error> {
Expand Down

0 comments on commit ce9c88a

Please sign in to comment.