Skip to content

Commit

Permalink
Added logging to check loop flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Dec 9, 2024
1 parent 132d081 commit f9ca818
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
11 changes: 3 additions & 8 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -4696,7 +4696,6 @@ def run_request_search(self):
(datetime.now() - self.api_call_timer).seconds,
)
self.request_search_timer = time.time()
return None
except NoConnectionrException as e:
self.logger.error(e.message)
raise DelayLoopException(length=300, type=e.type)
Expand Down Expand Up @@ -4829,14 +4828,10 @@ def run_search_loop(self) -> NoReturn:
self.refresh_download_queue()
self.db_update()
self.run_request_search()
self.logger.debug(
"%s api calls in %s seconds",
self.api_call_count,
(datetime.now() - self.api_call_timer).seconds,
)
self.logger.trace("Starting general search loop: %s", str(not searched))
try:
if not searched:
self.logger.trace("Getting general files")
for (
entry,
todays,
Expand Down Expand Up @@ -4883,11 +4878,11 @@ def run_search_loop(self) -> NoReturn:
elif datetime.now() >= (timer + loop_timer):
self.refresh_download_queue()
time.sleep(((timer + loop_timer) - datetime.now()).total_seconds())
self.logger.trace("Restarting loop testing")
self.logger.trace("Restarting loop testing 1")
raise RestartLoopException
elif datetime.now() >= (timer + loop_timer):
self.refresh_download_queue()
self.logger.trace("Restarting loop testing")
self.logger.trace("Restarting loop testing 2")
raise RestartLoopException
except RestartLoopException:
self.loop_completed = True
Expand Down
4 changes: 2 additions & 2 deletions qBitrr/gen_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def _add_qbit_section(config: TOMLDocument):
_gen_default_line(
qbit,
[
"If this is enable qBitrr can run in a headless mode where it will only process searches.",
"If this is enabled qBitrr can run in headless mode where it will only process searches.",
"If media search is enabled in their individual categories",
"This is useful if you use for example Sabnzbd/NZBGet for downloading content but still want the faster media searches provided by qbit",
],
Expand All @@ -140,7 +140,7 @@ def _add_qbit_section(config: TOMLDocument):
)
_gen_default_line(
qbit,
'qBit WebUI Port - Can be found in Options > Web UI (called "IP Address")',
'qBit WebUI URL/IP - Can be found in Options > Web UI (called "IP Address")',
"Host",
ENVIRO_CONFIG.qbit.host or "CHANGE_ME",
)
Expand Down
2 changes: 1 addition & 1 deletion qBitrr/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def has_internet(client: qbittorrentapi.Client):

url = random.choice(PING_URLS)
try:
if not is_connected(url) or client.transfer_info()["connection_status"] == "disconnected":
if not is_connected(url) and client.transfer_info()["connection_status"] == "disconnected":
return False
except:
logger.error("Error getting qbittorrent transfer info %s", client.transfer_info())
Expand Down

0 comments on commit f9ca818

Please sign in to comment.