Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
Delay after too many failed searches on saucenao
Browse files Browse the repository at this point in the history
  • Loading branch information
jacklul committed Mar 19, 2022
1 parent 4f949c5 commit b862e76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -944,9 +944,9 @@ function () use ($entry) {

$results = $this->reverseSearchSaucenao($this->PATH_IMAGES . '/' . $entry);

if (isset($results['error']) && $results['error'] === 'ShortLimitReached') {
if (isset($results['error']) && ($results['error'] === 'ShortLimitReached' || $results['error'] === 'FailedLimitReached')) {
$results = $this->applyCooldown(
30,
$results['error'] === 'ShortLimitReached' ? 30 : 60,
$results,
function () use ($entry) {
return $this->reverseSearchSaucenao($this->PATH_IMAGES . '/' . $entry);
Expand Down

0 comments on commit b862e76

Please # to comment.