Fix SQLX errors

This commit is contained in:
Geometrically 2020-12-31 19:09:23 -07:00
parent 0efeffeaa3
commit b8d2ef1eb5
No known key found for this signature in database
GPG Key ID: 90C056FDC8FC9FF0
4 changed files with 728 additions and 375 deletions

1087
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -43,14 +43,4 @@ futures-timer = "3.0.2"
rust-s3 = "0.26.1"
async-trait = "0.1.41"
[dependencies.sqlx]
git = "https://github.com/launchbadge/sqlx/"
branch = "master"
default-features = false
features = ["runtime-actix", "postgres", "chrono", "offline", "macros", "migrate"]
[dependencies.sqlx-macros]
git = "https://github.com/launchbadge/sqlx/"
branch = "master"
default-features = false
features = ["runtime-actix", "postgres", "chrono", "offline"]
sqlx = { version = "0.4.2", features = ["runtime-actix-rustls", "postgres", "chrono", "offline", "macros", "migrate"] }

View File

@ -1,6 +1,6 @@
use super::DatabaseError;
use crate::models::ids::random_base62_rng;
use sqlx_macros::Type;
use sqlx::sqlx_macros::Type;
const ID_RETRY_COUNT: usize = 20;

View File

@ -264,7 +264,7 @@ async fn main() -> std::io::Result<()> {
let ignore_ips = dotenv::var("RATE_LIMIT_IGNORE_IPS")
.ok()
.and_then(|s| serde_json::from_str::<Vec<String>>(&s).ok())
.unwrap_or_else(|| vec![]);
.unwrap_or(vec![]);
if ignore_ips.contains(&ip) {
// At an even distribution of numbers, this will allow at the most