mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-21 13:03:53 +02:00
Add an explicit garbage collection after a news download to ensure unused memory is reclaimed. Useful for people leaving calirbe running 24/7
This commit is contained in:
parent
78d492b554
commit
e3e03aa1a1
1 changed files with 5 additions and 2 deletions
|
|
@ -5,6 +5,8 @@
|
|||
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import gc
|
||||
|
||||
from PyQt4.Qt import Qt
|
||||
|
||||
from calibre.gui2 import Dispatcher
|
||||
|
|
@ -53,11 +55,11 @@ def download_scheduled_recipe(self, arg):
|
|||
|
||||
def scheduled_recipe_fetched(self, job):
|
||||
temp_files, fmt, arg = self.conversion_jobs.pop(job)
|
||||
pt = temp_files[0]
|
||||
fname = temp_files[0].name
|
||||
if job.failed:
|
||||
self.scheduler.recipe_download_failed(arg)
|
||||
return self.gui.job_exception(job)
|
||||
id = self.gui.library_view.model().add_news(pt.name, arg)
|
||||
id = self.gui.library_view.model().add_news(fname, arg)
|
||||
|
||||
# Arg may contain a "keep_issues" variable. If it is non-zero,
|
||||
# delete all but newest x issues.
|
||||
|
|
@ -81,5 +83,6 @@ def scheduled_recipe_fetched(self, job):
|
|||
self.gui.status_bar.show_message(arg['title'] + _(' fetched.'), 3000)
|
||||
self.gui.email_news(id)
|
||||
self.gui.sync_news()
|
||||
gc.collect()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue