mirror of
https://codeberg.org/icewind/rss-webhook-trigger.git
synced 2026-11-30 04:00:49 +01:00
typo
This commit is contained in:
parent
e441adb740
commit
ac55958f8c
1 changed files with 5 additions and 5 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -5,18 +5,18 @@ mod hub;
|
||||||
|
|
||||||
use crate::config::{Config, FeedConfig};
|
use crate::config::{Config, FeedConfig};
|
||||||
use crate::error::{FetchError, FetchFeedError, HubError, ParseFeedError};
|
use crate::error::{FetchError, FetchFeedError, HubError, ParseFeedError};
|
||||||
use crate::fetcher::{next_fetch, CacheHeaders, FetchPlan, FetchResponse};
|
use crate::fetcher::{CacheHeaders, FetchPlan, FetchResponse, next_fetch};
|
||||||
use main_error::MainResult;
|
use main_error::MainResult;
|
||||||
use std::collections::hash_map::DefaultHasher;
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use std::collections::hash_map::DefaultHasher;
|
||||||
use std::hash::{Hash, Hasher};
|
use std::hash::{Hash, Hasher};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::thread::sleep;
|
use std::thread::sleep;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
use tracing::{debug, error, info, instrument, warn};
|
use tracing::{debug, error, info, instrument, warn};
|
||||||
use ureq::http::header::{HeaderValue, USER_AGENT};
|
|
||||||
use ureq::http::Response;
|
use ureq::http::Response;
|
||||||
|
use ureq::http::header::{HeaderValue, USER_AGENT};
|
||||||
use ureq::{Agent, Body};
|
use ureq::{Agent, Body};
|
||||||
|
|
||||||
const FETCHER_USER_AGENT: &str = concat!(
|
const FETCHER_USER_AGENT: &str = concat!(
|
||||||
|
|
@ -68,11 +68,11 @@ fn main_loop(config: Config) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interruptable_sleep(config.interval());
|
interruptible_sleep(config.interval());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn interruptable_sleep(duration: Duration) {
|
fn interruptible_sleep(duration: Duration) {
|
||||||
let target = Instant::now() + duration;
|
let target = Instant::now() + duration;
|
||||||
while Instant::now() < target && RUNNING.load(Ordering::SeqCst) {
|
while Instant::now() < target && RUNNING.load(Ordering::SeqCst) {
|
||||||
sleep(Duration::from_millis(100));
|
sleep(Duration::from_millis(100));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue