Skip to content

Commit

Permalink
[build] Testing search issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Oct 27, 2023
1 parent 3762bd9 commit 86e6144
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,12 @@ def db_reset__movie_searched_state(self):
Ids = [id.Id for id in self.model_arr_file.select().execute()]
self.model_file.delete().where(self.model_file.EntryId.not_in(Ids)).execute()

def db_reset_arr_search_commands(self):
self.model_arr_command.delete().where(
self.model_arr_command.EndedAt.is_null(True)
& self.model_arr_command.Name.endswith("Search")
).execute()

def db_get_files_series(
self,
) -> Iterable[tuple[SeriesFilesModel, bool, bool]]:
Expand Down Expand Up @@ -3737,6 +3743,7 @@ def run_search_loop(self) -> NoReturn:
loop_timer = timedelta(minutes=15)
timer = datetime.now()
years_index = 0
self.db_reset_arr_search_commands()
while True:
if self.loop_completed:
years_index = 0
Expand Down Expand Up @@ -3783,9 +3790,7 @@ def run_search_loop(self) -> NoReturn:
time.sleep(30)
except RestartLoopException:
self.loop_completed = True
self.logger.info(
"Loop timer elapsed and search commands completed, restarting it."
)
self.logger.info("Loop timer elapsed, restarting it.")
except NoConnectionrException as e:
self.logger.error(e.message)
self.manager.qbit_manager.should_delay_torrent_scan = True
Expand Down

0 comments on commit 86e6144

Please sign in to comment.