diff --git a/server/Cargo.toml b/server/Cargo.toml index 17bd6446..2ad706a4 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -11,18 +11,16 @@ authors = ["ntr "] # rpath = true [dependencies] -rand = "0.6" -uuid = { version = "0.5", features = ["serde", "v4"] } serde = "1" serde_derive = "1" serde_cbor = "0.9" serde_json = "1.0" +rand = "0.6" +uuid = { version = "0.5", features = ["serde", "v4"] } chrono = { version = "0.4", features = ["serde"] } - bcrypt = "0.2" -dotenv = "0.9.0" postgres = { version = "0.15", features = ["with-uuid", "with-chrono"] } r2d2 = "*" r2d2_postgres = "*" @@ -30,6 +28,7 @@ fallible-iterator = "0.1" failure = "0.1" +dotenv = "0.9.0" log = "0.4" fern = "0.5" @@ -43,6 +42,6 @@ crossbeam-channel = "0.3" stripe-rust = { version = "0.10.4", features = ["webhooks"] } -[patch.crates-io] +# [patch.crates-io] # stripe-rust = { git = "https://github.com/margh/stripe-rs.git" } diff --git a/server/src/pubsub.rs b/server/src/pubsub.rs index f79e4861..eafa1eb8 100644 --- a/server/src/pubsub.rs +++ b/server/src/pubsub.rs @@ -51,11 +51,14 @@ fn handle_notification(n: Notification, db: &Db, pss: &Sender) -> Resul // maybe we need it let mut tx = db.transaction()?; - let msg = match n.table { - Table::Accounts => Message::Account(account::select(db, n.id)?), - Table::Instances => Message::Instance(instance::instance_get(&mut tx, n.id)?), - Table::Games => Message::Game(game::game_get(&mut tx, n.id)?), - _ => return Err(format_err!("unimplemented notification {:?}", n)), + let msg = match n.action { + Action::Delete => return Err(format_err!("unimplemented delete notification {:?}", n)), + _ => match n.table { + Table::Accounts => Message::Account(account::select(db, n.id)?), + Table::Instances => Message::Instance(instance::instance_get(&mut tx, n.id)?), + Table::Games => Message::Game(game::game_get(&mut tx, n.id)?), + _ => return Err(format_err!("unimplemented notification {:?}", n)), + }, }; tx.commit()?;