use net::Db;
// Db Commons
use failure::Error;

use game::{game_global_startup};

pub fn startup(db: Db) -> Result<(), Error> {
    let mut tx = db.transaction()?;

    println!("running startup fns");

    game_global_startup(&mut tx)?;

    match tx.commit() {
        Ok(_) => {
            println!("startup processes completed");
            Ok(())
        },
        Err(e) => Err(format_err!("failed to commit startup tx {:?}", e)),
    }
}