delete notifications ignored

This commit is contained in:
ntr 2019-07-18 12:50:52 +10:00
parent 9633e4f4c6
commit 860c70c4a1
2 changed files with 12 additions and 10 deletions

View File

@ -11,18 +11,16 @@ authors = ["ntr <ntr@smokestack.io>"]
# 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" }

View File

@ -51,11 +51,14 @@ fn handle_notification(n: Notification, db: &Db, pss: &Sender<Message>) -> 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()?;