Skip to content

Commit

Permalink
Address some performance concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
gazpachoking committed Feb 22, 2014
1 parent c386164 commit fb6a19c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions seedtime/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def enable(self):

def start_looping(self):
log.warning('seedtime loop starting')
self.looping_call.start(5)
self.looping_call.start(10)

def disable(self):
self.plugin.deregister_status_field("seed_stop_time")
Expand All @@ -85,11 +85,9 @@ def update(self):
def update_checker(self):
"""Check if any torrents have reached their stop seed time."""
for torrent in component.get("Core").torrentmanager.torrents.values():
if not torrent.torrent_id in self.torrent_stop_times:
if not (torrent.state == "Seeding" and torrent.torrent_id in self.torrent_stop_times):
continue
stop_time = self.torrent_stop_times[torrent.torrent_id]
log.debug('seedtime stop time %s' % stop_time)
log.debug('seedtime torrent seeding time %r' % torrent.get_status(['seeding_time']))
if torrent.get_status(['seeding_time'])['seeding_time'] > stop_time * 3600.0 * 24.0:
if self.config['remove_torrent']:
self.torrent_manager.remove(torrent.torrent_id)
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
__plugin_name__ = "SeedTime"
__author__ = "Chase Sterling"
__author_email__ = "[email protected]"
__version__ = "0.4"
__version__ = "0.5"
__url__ = ""
__license__ = "GPLv3"
__description__ = ""
__description__ = "Automatically pause or remove torrents after specified amount of seeding."
__long_description__ = """"""
__pkg_data__ = {__plugin_name__.lower(): ["template/*", "data/*"]}

Expand Down

0 comments on commit fb6a19c

Please sign in to comment.