Record committed best-bid and ask changes for resumable quote history
This commit is contained in:
@@ -12,7 +12,8 @@ pub(crate) fn transaction(
|
||||
let tx = Transaction::new_unchecked(db, behavior)?;
|
||||
let due: bool = tx.query_row(
|
||||
"SELECT EXISTS(SELECT 1 FROM order_deadlines WHERE pending=1 AND expiration<=unixepoch()+60)
|
||||
OR EXISTS(SELECT 1 FROM twap_markets WHERE pending_close=1 AND end_at<=unixepoch())",
|
||||
OR EXISTS(SELECT 1 FROM twap_markets WHERE pending_close=1 AND end_at<=unixepoch())
|
||||
OR EXISTS(SELECT 1 FROM quote_pending)",
|
||||
[], |row| row.get(0),
|
||||
)?;
|
||||
if !due {
|
||||
@@ -44,6 +45,7 @@ pub(crate) fn transaction(
|
||||
for market in markets {
|
||||
crate::market::close_market(&write, &market)?;
|
||||
}
|
||||
crate::quotes::flush(&write)?;
|
||||
write.commit()?;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user