use DB::init function instead of manual connection and migration
This commit is contained in:
parent
09f7e76d96
commit
b318e3ec8e
@ -74,8 +74,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let config = Config::init_from_env()?;
|
||||
|
||||
let bot = Bot::new(&config.bot_token);
|
||||
let mut db = DB::new(&config.db_url).await;
|
||||
db.migrate().await.unwrap();
|
||||
let mut db = DB::init(&config.db_url).await;
|
||||
let db_url2 = config.db_url.clone();
|
||||
let state_mgr = MongodbStorage::open(&db_url2, "gongbot", Json).await?;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user