Skip to content

Commit

Permalink
Merge pull request #103 from paritytech/dp-fix-warnings
Browse files Browse the repository at this point in the history
Fix a few warnings
  • Loading branch information
dvdplm authored Oct 15, 2020
2 parents 5c943db + 2b99d6b commit c73b705
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
6 changes: 3 additions & 3 deletions sqlx-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@
]
}
},
"f1a15dd2b69242061774eb65c073174b671182a43ca6839246f5b6e6039ae46b": {
"query": "SELECT missing_num\n FROM (SELECT MAX(block_num) AS max_num FROM blocks) max, \n GENERATE_SERIES($1, max_num) AS missing_num\n WHERE\n NOT EXISTS (SELECT id FROM blocks WHERE block_num = missing_num)\n ORDER BY missing_num ASC\n LIMIT $2\n ",
"5f87852941e1c1850206ced095d9f6e66ff7060dad484232bb01955c4159118d": {
"query": "SELECT missing_num\n FROM (SELECT MAX(block_num) AS max_num FROM blocks) max,\n GENERATE_SERIES($1, max_num) AS missing_num\n WHERE\n NOT EXISTS (SELECT id FROM blocks WHERE block_num = missing_num)\n ORDER BY missing_num ASC\n LIMIT $2\n ",
"describe": {
"columns": [
{
Expand All @@ -355,4 +355,4 @@
]
}
}
}
}
9 changes: 2 additions & 7 deletions src/database/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,7 @@ impl Listener {
mod tests {
use super::*;
use futures::{SinkExt, StreamExt};
use once_cell::sync::Lazy;
use sqlx::{Connection, Executor};
use std::sync::{
atomic::{AtomicUsize, Ordering},
Arc,
};
use sqlx::Connection;

#[test]
fn should_get_notifications() {
Expand All @@ -235,7 +230,7 @@ mod tests {
smol::block_on(async move {
let (tx, mut rx) = futures::channel::mpsc::channel(5);

let listener = Builder::new(&crate::DATABASE_URL, move |_, _| {
let _listener = Builder::new(&crate::DATABASE_URL, move |_, _| {
let mut tx1 = tx.clone();
async move {
log::info!("Hello");
Expand Down
2 changes: 1 addition & 1 deletion src/database/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub(crate) async fn missing_blocks_min_max(
Ok(sqlx::query_as!(
Series,
"SELECT missing_num
FROM (SELECT MAX(block_num) AS max_num FROM blocks) max,
FROM (SELECT MAX(block_num) AS max_num FROM blocks) max,
GENERATE_SERIES($1, max_num) AS missing_num
WHERE
NOT EXISTS (SELECT id FROM blocks WHERE block_num = missing_num)
Expand Down

0 comments on commit c73b705

Please sign in to comment.