-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f81b76
commit 1f23449
Showing
5 changed files
with
84 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use std::{sync::Arc, time::Duration}; | ||
|
||
use mapper_influences_backend_rs::{ | ||
daily_update::update_once, | ||
database::DatabaseClient, | ||
osu_api::{credentials_grant::CredentialsGrantClient, request::OsuApiRequestClient}, | ||
}; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
dotenvy::dotenv().ok(); | ||
|
||
tracing_subscriber::fmt() | ||
.with_max_level(tracing::Level::DEBUG) | ||
.init(); | ||
|
||
let url = std::env::var("SURREAL_URL").expect("Missing SURREAL_URL environment variable"); | ||
let db = DatabaseClient::new(&url) | ||
.await | ||
.expect("failed to initialize db connection"); | ||
|
||
let users = db.get_users_to_update().await.unwrap(); | ||
|
||
let request_client = Arc::new(OsuApiRequestClient::new(100)); | ||
let credentials_grant_client = CredentialsGrantClient::new(request_client).await.unwrap(); | ||
|
||
let unsuccessfuls = update_once( | ||
credentials_grant_client, | ||
db, | ||
users, | ||
Duration::from_millis(300), | ||
) | ||
.await; | ||
|
||
dbg!(unsuccessfuls); | ||
} |