From fa11b4ef3ab20ec56d3b49ffbfbff2dee20cccda Mon Sep 17 00:00:00 2001 From: echel0n Date: Tue, 20 May 2014 11:01:51 -0700 Subject: [PATCH] Removed some sleep timers to improve overall speed of sickrage. --- sickbeard/providers/btn.py | 2 -- sickbeard/providers/generic.py | 2 -- sickbeard/providers/hdbits.py | 2 -- sickbeard/providers/hdtorrents.py | 2 -- sickbeard/providers/iptorrents.py | 2 -- sickbeard/providers/kat.py | 2 -- sickbeard/providers/newznab.py | 2 -- sickbeard/providers/nextgen.py | 2 -- sickbeard/providers/publichd.py | 2 -- sickbeard/providers/scc.py | 2 -- sickbeard/providers/speedcd.py | 2 -- sickbeard/providers/thepiratebay.py | 2 -- sickbeard/providers/torrentday.py | 2 -- sickbeard/providers/torrentleech.py | 2 -- sickbeard/subtitles.py | 2 -- sickbeard/tvcache.py | 4 ---- sickbeard/webserve.py | 8 ++++---- 17 files changed, 4 insertions(+), 38 deletions(-) diff --git a/sickbeard/providers/btn.py b/sickbeard/providers/btn.py index 5f62b9eb..c04d7ebb 100644 --- a/sickbeard/providers/btn.py +++ b/sickbeard/providers/btn.py @@ -338,8 +338,6 @@ class BTNCache(tvcache.TVCache): if ci is not None: cl.append(ci) - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/providers/generic.py b/sickbeard/providers/generic.py index 299a1d41..a4e297f2 100644 --- a/sickbeard/providers/generic.py +++ b/sickbeard/providers/generic.py @@ -280,8 +280,6 @@ class GenericProvider: for ep_obj in searchItems: for item in searchItems[ep_obj]: - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - (title, url) = self._get_title_and_url(item) quality = self.getQuality(item) diff --git a/sickbeard/providers/hdbits.py b/sickbeard/providers/hdbits.py index 1bcdbce4..91797860 100644 --- a/sickbeard/providers/hdbits.py +++ b/sickbeard/providers/hdbits.py @@ -233,8 +233,6 @@ class HDBitsCache(tvcache.TVCache): if ci is not None: ql.append(ci) - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - myDB = self._getDB() myDB.mass_action(ql) diff --git a/sickbeard/providers/hdtorrents.py b/sickbeard/providers/hdtorrents.py index 1e978c4b..5d48105a 100644 --- a/sickbeard/providers/hdtorrents.py +++ b/sickbeard/providers/hdtorrents.py @@ -367,8 +367,6 @@ class HDTorrentsCache(tvcache.TVCache): if ci is not None: cl.append(ci) - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/providers/iptorrents.py b/sickbeard/providers/iptorrents.py index 041c3695..ec48aa40 100644 --- a/sickbeard/providers/iptorrents.py +++ b/sickbeard/providers/iptorrents.py @@ -308,8 +308,6 @@ class IPTorrentsCache(tvcache.TVCache): if ci is not None: cl.append(ci) - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/providers/kat.py b/sickbeard/providers/kat.py index bc52c03b..d4136b5f 100644 --- a/sickbeard/providers/kat.py +++ b/sickbeard/providers/kat.py @@ -445,8 +445,6 @@ class KATCache(tvcache.TVCache): if ci is not None: cl.append(ci) - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/providers/newznab.py b/sickbeard/providers/newznab.py index 1f8a6db2..dec57370 100644 --- a/sickbeard/providers/newznab.py +++ b/sickbeard/providers/newznab.py @@ -323,8 +323,6 @@ class NewznabCache(tvcache.TVCache): if ci is not None: ql.append(ci) - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - myDB = self._getDB() myDB.mass_action(ql) diff --git a/sickbeard/providers/nextgen.py b/sickbeard/providers/nextgen.py index 9f973e37..530140d1 100644 --- a/sickbeard/providers/nextgen.py +++ b/sickbeard/providers/nextgen.py @@ -357,8 +357,6 @@ class NextGenCache(tvcache.TVCache): if ci is not None: cl.append(ci) - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/providers/publichd.py b/sickbeard/providers/publichd.py index 8a6ad523..52756bf5 100644 --- a/sickbeard/providers/publichd.py +++ b/sickbeard/providers/publichd.py @@ -337,8 +337,6 @@ class PublicHDCache(tvcache.TVCache): if ci is not None: ql.append(ci) - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - myDB = self._getDB() myDB.mass_action(ql) diff --git a/sickbeard/providers/scc.py b/sickbeard/providers/scc.py index bfacd61e..dfa1a982 100644 --- a/sickbeard/providers/scc.py +++ b/sickbeard/providers/scc.py @@ -352,8 +352,6 @@ class SCCCache(tvcache.TVCache): if ci is not None: cl.append(ci) - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/providers/speedcd.py b/sickbeard/providers/speedcd.py index 10ffaf2a..f424ff0d 100644 --- a/sickbeard/providers/speedcd.py +++ b/sickbeard/providers/speedcd.py @@ -288,8 +288,6 @@ class SpeedCDCache(tvcache.TVCache): if ci is not None: ql.append(ci) - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - myDB = self._getDB() myDB.mass_action(ql) diff --git a/sickbeard/providers/thepiratebay.py b/sickbeard/providers/thepiratebay.py index d7c5d52d..772e5411 100644 --- a/sickbeard/providers/thepiratebay.py +++ b/sickbeard/providers/thepiratebay.py @@ -426,8 +426,6 @@ class ThePirateBayCache(tvcache.TVCache): if ci is not None: cl.append(ci) - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/providers/torrentday.py b/sickbeard/providers/torrentday.py index a1166456..95738fd8 100644 --- a/sickbeard/providers/torrentday.py +++ b/sickbeard/providers/torrentday.py @@ -315,8 +315,6 @@ class TorrentDayCache(tvcache.TVCache): if ci is not None: cl.append(ci) - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/providers/torrentleech.py b/sickbeard/providers/torrentleech.py index 2c41fe22..1e13efe2 100644 --- a/sickbeard/providers/torrentleech.py +++ b/sickbeard/providers/torrentleech.py @@ -311,8 +311,6 @@ class TorrentLeechCache(tvcache.TVCache): if ci is not None: cl.append(ci) - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/subtitles.py b/sickbeard/subtitles.py index 7b9e5ca5..06a70e98 100644 --- a/sickbeard/subtitles.py +++ b/sickbeard/subtitles.py @@ -116,8 +116,6 @@ class SubtitlesFinder(): now = datetime.datetime.now() for epToSub in sqlResults: - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - if not ek.ek(os.path.isfile, epToSub['location']): logger.log('Episode file does not exist, cannot download subtitles for episode %dx%d of show %s' % (epToSub['season'], epToSub['episode'], epToSub['show_name']), logger.DEBUG) continue diff --git a/sickbeard/tvcache.py b/sickbeard/tvcache.py index 1d7b7865..fae2bbbd 100644 --- a/sickbeard/tvcache.py +++ b/sickbeard/tvcache.py @@ -127,8 +127,6 @@ class TVCache(): if ci is not None: cl.append(ci) - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - myDB = self._getDB() myDB.mass_action(cl) @@ -378,8 +376,6 @@ class TVCache(): # for each cache entry for curResult in sqlResults: - time.sleep(cpu_presets[sickbeard.CPU_PRESET]) - # skip non-tv crap (but allow them for Newzbin cause we assume it's filtered well) if self.providerID != 'newzbin' and not show_name_helpers.filterBadReleases(curResult["name"]): continue diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index ce5246ee..eb6de0be 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -3101,14 +3101,14 @@ class Home: if do_update: try: sickbeard.showQueueScheduler.action.updateShow(showObj, True) # @UndefinedVariable - time.sleep(1) + time.sleep(cpu_presets[sickbeard.CPU_PRESET]) except exceptions.CantUpdateException, e: errors.append("Unable to force an update on the show.") if do_update_exceptions: try: scene_exceptions.update_scene_exceptions(showObj.indexerid, exceptions_list) # @UndefinedVariable - time.sleep(1) + time.sleep(cpu_presets[sickbeard.CPU_PRESET]) except exceptions.CantUpdateException, e: errors.append("Unable to force an update on scene exceptions of the show.") @@ -3454,7 +3454,7 @@ class Home: # wait until the queue item tells us whether it worked or not while ep_queue_item.success is None: # @UndefinedVariable - time.sleep(1) + time.sleep(cpu_presets[sickbeard.CPU_PRESET]) # return the correct json value if ep_queue_item.success: @@ -3551,7 +3551,7 @@ class Home: # wait until the queue item tells us whether it worked or not while ep_queue_item.success is None: # @UndefinedVariable - time.sleep(1) + time.sleep(cpu_presets[sickbeard.CPU_PRESET]) # return the correct json value if ep_queue_item.success: