add the initial event
This commit is contained in:
parent
7beb26d5ae
commit
14cd99448a
1 changed files with 4 additions and 1 deletions
|
@ -43,13 +43,15 @@ pub struct DatabaseUpdate {}
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
let (tx, database_updates) = mpsc::unbounded_channel();
|
||||
let (mut tx, database_updates) = mpsc::unbounded_channel();
|
||||
|
||||
let db = {
|
||||
let options = SqliteConnectOptions::new()
|
||||
.filename("test.db")
|
||||
.create_if_missing(true);
|
||||
|
||||
let tx = tx.clone();
|
||||
|
||||
SqlitePoolOptions::new()
|
||||
.after_connect(move |c, md| {
|
||||
let tx = tx.clone();
|
||||
|
@ -72,6 +74,7 @@ async fn main() -> Result<()> {
|
|||
let state = AppState { db };
|
||||
|
||||
tokio::spawn(worker(state.clone(), database_updates));
|
||||
tx.send(DatabaseUpdate {});
|
||||
|
||||
let app = Router::new()
|
||||
// Block CRUD
|
||||
|
|
Loading…
Reference in a new issue