Skip to content

Commit

Permalink
lets not skip the first run
Browse files Browse the repository at this point in the history
  • Loading branch information
danitrap committed Dec 30, 2023
1 parent 09631bd commit bfefe1f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ async fn main() {
SimpleLogger::new().init().unwrap();
let mut interval = interval(Duration::from_secs(60 * 10));
let mut hacker_news = HackerNews::new();
let mut first_run = true;

let config = match Config::new() {
Ok(config) => config,
Expand All @@ -34,7 +33,7 @@ async fn main() {

log::info!("Fetching Hacker News");

let content = fetch_hacker_news().await;
let content = setch_hacker_news().await;
if content.is_err() {
log::error!("Error fetching Hacker News: {:?}", content);
continue;
Expand Down Expand Up @@ -64,12 +63,6 @@ async fn main() {

let new_items = hacker_news.whats_new(items);

if first_run {
first_run = false;
log::info!("Skipping first run");
continue;
}

match new_items {
None => {
log::info!("No new items");
Expand Down

0 comments on commit bfefe1f

Please sign in to comment.