Server tools to backfill, tail, mirror, and verify PLC logs

use url from reqwest

save a direct dependency

+3 -5
-1
Cargo.lock
··· 47 "tokio-postgres", 48 "tokio-stream", 49 "tokio-util", 50 - "url", 51 ] 52 53 [[package]]
··· 47 "tokio-postgres", 48 "tokio-stream", 49 "tokio-util", 50 ] 51 52 [[package]]
-1
Cargo.toml
··· 24 tokio-postgres = { version = "0.7.13", features = ["with-chrono-0_4", "with-serde_json-1"] } 25 tokio-stream = { version = "0.1.17", features = ["io-util"] } 26 tokio-util = { version = "0.7.16", features = ["compat"] } 27 - url = "2.5.7"
··· 24 tokio-postgres = { version = "0.7.13", features = ["with-chrono-0_4", "with-serde_json-1"] } 25 tokio-stream = { version = "0.1.17", features = ["io-util"] } 26 tokio-util = { version = "0.7.16", features = ["compat"] }
+1 -1
src/bin/allegedly.rs
··· 3 bin_init, pages_to_pg, pages_to_weeks, poll_upstream, 4 }; 5 use clap::{Parser, Subcommand}; 6 use std::{path::PathBuf, time::Instant}; 7 use tokio::sync::{mpsc, oneshot}; 8 - use url::Url; 9 10 #[derive(Debug, Parser)] 11 struct Cli {
··· 3 bin_init, pages_to_pg, pages_to_weeks, poll_upstream, 4 }; 5 use clap::{Parser, Subcommand}; 6 + use reqwest::Url; 7 use std::{path::PathBuf, time::Instant}; 8 use tokio::sync::{mpsc, oneshot}; 9 10 #[derive(Debug, Parser)] 11 struct Cli {
+1 -1
src/poll.rs
··· 1 use crate::{CLIENT, Dt, ExportPage, Op, OpKey}; 2 use std::time::Duration; 3 use thiserror::Error; 4 use tokio::sync::mpsc; 5 - use url::Url; 6 7 // plc.directory ratelimit on /export is 500 per 5 mins 8 const UPSTREAM_REQUEST_INTERVAL: Duration = Duration::from_millis(600);
··· 1 use crate::{CLIENT, Dt, ExportPage, Op, OpKey}; 2 + use reqwest::Url; 3 use std::time::Duration; 4 use thiserror::Error; 5 use tokio::sync::mpsc; 6 7 // plc.directory ratelimit on /export is 500 per 5 mins 8 const UPSTREAM_REQUEST_INTERVAL: Duration = Duration::from_millis(600);
+1 -1
src/weekly.rs
··· 2 use async_compression::tokio::bufread::GzipDecoder; 3 use async_compression::tokio::write::GzipEncoder; 4 use core::pin::pin; 5 use std::future::Future; 6 use std::ops::{Bound, RangeBounds}; 7 use std::path::PathBuf; ··· 12 }; 13 use tokio_stream::wrappers::LinesStream; 14 use tokio_util::compat::FuturesAsyncReadCompatExt; 15 - use url::Url; 16 17 const WEEK_IN_SECONDS: i64 = 7 * 86_400; 18
··· 2 use async_compression::tokio::bufread::GzipDecoder; 3 use async_compression::tokio::write::GzipEncoder; 4 use core::pin::pin; 5 + use reqwest::Url; 6 use std::future::Future; 7 use std::ops::{Bound, RangeBounds}; 8 use std::path::PathBuf; ··· 13 }; 14 use tokio_stream::wrappers::LinesStream; 15 use tokio_util::compat::FuturesAsyncReadCompatExt; 16 17 const WEEK_IN_SECONDS: i64 = 7 * 86_400; 18