Change retry sleep timeout for Trakt searches to prevent issues when Trakt is down.

Multiply timeout with indexercount + 1 (trakt) + retry and web interface timeout of 15 seconds.
This commit is contained in:
Prinz23 2016-11-01 16:34:18 +01:00 committed by JackDandy
parent 21f1cb2714
commit f50508df1f
4 changed files with 6 additions and 2 deletions

View file

@ -220,6 +220,7 @@
* Change improve reverse proxy web_root support * Change improve reverse proxy web_root support
* Fix "error trying to retrieve image" from tvdb due to there is no image to fetch * Fix "error trying to retrieve image" from tvdb due to there is no image to fetch
* Fix PiSexy for vip user class * Fix PiSexy for vip user class
* Change retry sleep timeout for Trakt searches to prevent issues when Trakt is down
### 0.11.16 (2016-10-16 17:30:00 UTC) ### 0.11.16 (2016-10-16 17:30:00 UTC)

View file

@ -10,6 +10,8 @@
#import os.path #import os.path
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl') #include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl')
#set indexer_count = len([$i for $i in $sickbeard.indexerApi().indexers if $sickbeard.indexerApi(i).config.get('active', False) and not $sickbeard.indexerApi(i).config.get('defunct', False)]) + 1
<script> <script>
var show_scene_maps = ${show_scene_maps} var show_scene_maps = ${show_scene_maps}
</script> </script>
@ -39,6 +41,7 @@
<div class="stepDiv"> <div class="stepDiv">
<input type="hidden" id="indexer_timeout" value="$sickbeard.INDEXER_TIMEOUT" /> <input type="hidden" id="indexer_timeout" value="$sickbeard.INDEXER_TIMEOUT" />
<input type="hidden" id="indexer_count" value="$indexer_count" />
#if $use_provided_info #if $use_provided_info
#set $provided_indexer_local = $provided_indexer #set $provided_indexer_local = $provided_indexer

View file

@ -66,7 +66,7 @@ $(document).ready(function () {
'lang': elIndexerLang.val(), 'lang': elIndexerLang.val(),
'indexer': elTvDatabase.val() 'indexer': elTvDatabase.val()
}, },
timeout: parseInt($('#indexer_timeout').val(), 10) * 1000, timeout: parseInt($('#indexer_timeout').val(), 10) * parseInt($('#indexer_count').val(), 2) * 1000 + 15000,
dataType: 'json', dataType: 'json',
error: function () { error: function () {
$('#searchResults').empty().html('search timed out, try again or try another database'); $('#searchResults').empty().html('search timed out, try again or try another database');

View file

@ -2426,7 +2426,7 @@ class NewHomeAddShows(Home):
filtered = [] filtered = []
try: try:
resp = TraktAPI().trakt_request(url) resp = TraktAPI().trakt_request(url, sleep_retry=5)
if len(resp): if len(resp):
filtered = resp filtered = resp
except TraktException as e: except TraktException as e: