From b8c0bd86389cfaa2d0c1c0948abc4380d6426d30 Mon Sep 17 00:00:00 2001 From: msglm Date: Sun, 22 Jan 2023 19:01:28 -0600 Subject: remove retry system that bogs slower connections --- src/indeedwatcher.nim | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/indeedwatcher.nim b/src/indeedwatcher.nim index c1946dc..69c0071 100644 --- a/src/indeedwatcher.nim +++ b/src/indeedwatcher.nim @@ -30,10 +30,6 @@ if not fileExists(getCacheDir() & "/indeedwatcher/config.toml"): writeFile(getCacheDir() & "/indeedwatcher/listings.cache", "") - - -#TODO make this create folders and files for this automatically upon first start up - #Reading the config file let config = parsetoml.parseFile(getConfigDir() & "/indeedwatcher/config.toml") @@ -74,17 +70,13 @@ setControlCHook(terminate) for feed in feeds: #Getting the listing URLs from the feeds - echo "now reading " & feed var rssFeedReply: RSS - for attempt in countup(0,5): - try: - rssFeedReply = getRSS(feed) - except: - if attempt < 5 - 1: - continue - else: - raise - break + #TODO implement a retry-on-fail system + try: + echo "now reading " & feed + rssFeedReply = getRSS(feed) + except: + raise for entry in rssFeedReply.items: @@ -98,6 +90,7 @@ for feed in feeds: var URL = entry.link let URLID = entry.link.split('&')[3] if not any(cache, proc (input: string): bool = input.contains(URLID)): + echo "Telling chromium to navigate to " & URL session.navigate(URL) counter = counter + 1 -- cgit v1.2.3