From 66c86ebfd6726730d2c1e97f9b1ca4f9b392faa1 Mon Sep 17 00:00:00 2001 From: "Aode (lion)" Date: Fri, 3 Dec 2021 16:17:25 -0600 Subject: [PATCH] Update deps, add drone --- .drone.yml | 136 ++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.lock | 120 +++++++++++++++--------------------------- src/requests.rs | 8 +-- 3 files changed, 181 insertions(+), 83 deletions(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..c8c86f0 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,136 @@ +kind: pipeline +type: docker +name: clippy + +platform: + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: alpine/git:latest + user: root + commands: + - git clone $DRONE_GIT_HTTP_URL . + - git checkout $DRONE_COMMIT + - chown -R 991:991 . + +- name: clippy + image: asonix/rust-builder:amd64-latest + pull: always + commands: + - rustup component add clippy + - cargo clippy --no-default-features + +--- + +kind: pipeline +type: docker +name: tests + +platform: + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: alpine/git:latest + user: root + commands: + - git clone $DRONE_GIT_HTTP_URL . + - git checkout $DRONE_COMMIT + - chown -R 991:991 . + +- name: tests + image: asonix/rust-builder:amd64-latest + pull: always + commands: + - cargo test + +--- + +kind: pipeline +type: docker +name: build-amd64 + +platform: + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: alpine/git:latest + user: root + commands: + - git clone $DRONE_GIT_HTTP_URL . + - git checkout $DRONE_COMMIT + - chown -R 991:991 . + +- name: build + image: asonix/rust-builder:amd64-latest + pull: always + commands: + - cargo check --target=x86_64-unknown-linux-musl + - cargo build --target=x86_64-unknown-linux-musl --release + +--- + +kind: pipeline +type: docker +name: build-arm64v8 + +platform: + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: alpine/git:latest + user: root + commands: + - git clone $DRONE_GIT_HTTP_URL . + - git checkout $DRONE_COMMIT + - chown -R 991:991 . + +- name: build + image: asonix/rust-builder:arm64v8-latest + pull: always + commands: + - cargo check --target=aarch64-unknown-linux-musl + - cargo build --target=aarch64-unknown-linux-musl --release + +--- + +kind: pipeline +type: docker +name: build-arm32v7 + +platform: + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: alpine/git:latest + user: root + commands: + - git clone $DRONE_GIT_HTTP_URL . + - git checkout $DRONE_COMMIT + - chown -R 991:991 . + +- name: build + image: asonix/rust-builder:arm32v7-latest + pull: always + commands: + - cargo check --target=armv7-unknown-linux-musleabihf + - cargo build --target=armv7-unknown-linux-musleabihf --release diff --git a/Cargo.lock b/Cargo.lock index 138dd59..6ae3358 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,9 +57,9 @@ dependencies = [ [[package]] name = "actix-http" -version = "3.0.0-beta.13" +version = "3.0.0-beta.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc3f9d97e32d75fae3ad7d955ac005eea3fd3ea60a89132768700911a60fd94" +checksum = "055b723746f19534fc5c9a210788686542986d6f1b9cb2900a297bb4c6619f3b" dependencies = [ "actix-codec", "actix-rt", @@ -157,9 +157,9 @@ dependencies = [ [[package]] name = "actix-tls" -version = "3.0.0-beta.9" +version = "3.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d4739910b49c77ea88308a9fbfae544524b34884161527f9978c0102052da0" +checksum = "4a78e066ef965e3501b0710f0722d0741e025b09e01f1af13afba0774efc2f40" dependencies = [ "actix-codec", "actix-rt", @@ -187,9 +187,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.0.0-beta.12" +version = "4.0.0-beta.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e87cfc4efaad42f8a054e269d1b85046397ff4e8707e49128dea3f99a512a9d6" +checksum = "1657eb2ed5e8ef246b6e951bafb38644ca433042a65a44f02e5601083b71b895" dependencies = [ "actix-codec", "actix-http", @@ -214,7 +214,7 @@ dependencies = [ "mime", "once_cell", "paste", - "pin-project", + "pin-project-lite", "regex", "serde 1.0.130", "serde_json", @@ -286,15 +286,6 @@ dependencies = [ "url", ] -[[package]] -name = "ansi_term" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -dependencies = [ - "winapi", -] - [[package]] name = "ansi_term" version = "0.12.1" @@ -306,9 +297,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.48" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e1f47f7dc0422027a4e370dd4548d4d66b26782e513e98dca1e689e058a80e" +checksum = "8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203" [[package]] name = "arrayvec" @@ -392,9 +383,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "awc" -version = "3.0.0-beta.11" +version = "3.0.0-beta.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f7d0c472987e454f41c3f4c7fa336ca139707ab255644b0480144c2060c800" +checksum = "e9fef22345ed9fc111adf13c3b1e48473136a2669a73680b82d18d6e71e720fe" dependencies = [ "actix-codec", "actix-http", @@ -575,11 +566,11 @@ dependencies = [ [[package]] name = "clap" -version = "2.33.3" +version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ - "ansi_term 0.11.0", + "ansi_term", "atty", "bitflags", "strsim", @@ -627,9 +618,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.2.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3825b1e8580894917dc4468cb634a1b4e9745fddc854edad72d9c04644c0319f" +checksum = "738c290dfaea84fc1ca15ad9c168d083b05a714e1efddd8edaab678dc28d2836" dependencies = [ "cfg-if", ] @@ -690,9 +681,9 @@ dependencies = [ [[package]] name = "der" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28e98c534e9c8a0483aa01d6f6913bc063de254311bd267c9cf535e9b70e15b2" +checksum = "79b71cca7d95d7681a4b3b9cdf63c8dbc3730d0584c2c74e31416d64a90493f4" dependencies = [ "const-oid", "crypto-bigint", @@ -700,9 +691,9 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.16" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40eebddd2156ce1bb37b20bbe5151340a31828b1f2d22ba4141f3531710e38df" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", "proc-macro2", @@ -1305,9 +1296,9 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memoffset" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" dependencies = [ "autocfg 1.0.1", ] @@ -1581,15 +1572,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -[[package]] -name = "pest" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" -dependencies = [ - "ucd-trie", -] - [[package]] name = "petgraph" version = "0.5.1" @@ -2073,9 +2055,9 @@ checksum = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2" [[package]] name = "rustc_version" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ "semver", ] @@ -2094,9 +2076,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "3c9613b5a66ab9ba26415184cfc41156594925a9cf3a2057e57f31ff145f6568" [[package]] name = "scopeguard" @@ -2116,21 +2098,9 @@ dependencies = [ [[package]] name = "semver" -version = "0.11.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] +checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" [[package]] name = "serde" @@ -2172,9 +2142,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.71" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063bf466a64011ac24040a49009724ee60a57da1b437617ceb32e53ad61bfb19" +checksum = "d0ffa0837f2dfa6fb90868c2b5468cad482e175f7dad97e7421951e663f2b527" dependencies = [ "itoa", "ryu", @@ -2366,9 +2336,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" +checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59" dependencies = [ "proc-macro2", "quote", @@ -2669,9 +2639,9 @@ dependencies = [ [[package]] name = "tracing-actix-web" -version = "0.5.0-beta.3" +version = "0.5.0-beta.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "994e4a59135823bdca121a8d086e3fcc71741c8677b47fa95a6afdd15e8f646f" +checksum = "a90ef8ed903a84ce2c0cf35bd2896e55e22eaa5e2b49c4f16167f4615bb204ac" dependencies = [ "actix-web", "pin-project", @@ -2693,19 +2663,17 @@ dependencies = [ [[package]] name = "tracing-awc" -version = "0.1.0-beta.10" +version = "0.1.0-beta.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049a7039068783ea0315b94cd727e80ddf8b5f302e908876d58d33e318b79e72" +checksum = "7b79f7237bb46dbb931e2daafc1b89371dcf0759054ec9a2b1df40096a937a8f" dependencies = [ "actix-http", + "actix-service", "awc", "bytes", - "encoding_rs", "futures-core", - "mime", - "serde 1.0.130", + "pin-project-lite", "tracing", - "tracing-futures", ] [[package]] @@ -2763,11 +2731,11 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507ec620f809cdf07cccb5bc57b13069a88031b795efd4079b1c71b66c1613d" +checksum = "245da694cc7fc4729f3f418b304cb57789f1bed2a78c575407ab8a23f53cb4d3" dependencies = [ - "ansi_term 0.12.1", + "ansi_term", "lazy_static", "matchers", "regex", @@ -2791,12 +2759,6 @@ version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" -[[package]] -name = "ucd-trie" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" - [[package]] name = "unicode-bidi" version = "0.3.7" diff --git a/src/requests.rs b/src/requests.rs index 1498183..72c24c9 100644 --- a/src/requests.rs +++ b/src/requests.rs @@ -17,7 +17,7 @@ use std::{ time::SystemTime, }; use tracing::{debug, info, warn}; -use tracing_awc::Propagate; +use tracing_awc::Tracing; #[derive(Clone)] pub(crate) struct Breakers { @@ -167,6 +167,7 @@ impl Requests { Requests { client: Rc::new(RefCell::new( Client::builder() + .wrap(Tracing) .header("User-Agent", user_agent.clone()) .finish(), )), @@ -185,6 +186,7 @@ impl Requests { if count + 1 >= self.error_limit { warn!("{} consecutive errors, rebuilding http client", count); *self.client.borrow_mut() = Client::builder() + .wrap(Tracing) .header("User-Agent", self.user_agent.clone()) .finish(); self.reset_err(); @@ -234,7 +236,6 @@ impl Requests { move |signing_string| signer.sign(signing_string), ) .await? - .propagate() .send() .await; @@ -293,7 +294,6 @@ impl Requests { move |signing_string| signer.sign(signing_string), ) .await? - .propagate() .send() .await; @@ -373,7 +373,7 @@ impl Requests { .await? .split(); - let res = req.propagate().send_body(body).await; + let res = req.send_body(body).await; if res.is_err() { self.count_err();