From 1d1f3b1920feab52b7caad1183655023067ed306 Mon Sep 17 00:00:00 2001 From: Ardhi Putra Pratama H Date: Mon, 25 Apr 2016 17:10:39 +0200 Subject: [PATCH] readd share_mode and disabled_checkpoint --- Tribler/Core/APIImplementation/LaunchManyCore.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Tribler/Core/APIImplementation/LaunchManyCore.py b/Tribler/Core/APIImplementation/LaunchManyCore.py index 3ea7c04329f..621377fc46c 100644 --- a/Tribler/Core/APIImplementation/LaunchManyCore.py +++ b/Tribler/Core/APIImplementation/LaunchManyCore.py @@ -257,7 +257,7 @@ def load_communities(): self.initComplete = True - def add(self, tdef, dscfg, pstate=None, initialdlstatus=None, setupDelay=0, hidden=False, share_mode=False): + def add(self, tdef, dscfg, pstate=None, initialdlstatus=None, setupDelay=0, hidden=False, share_mode=False,checkpoint_disabled=False): """ Called by any thread """ d = None with self.sesslock: @@ -281,7 +281,8 @@ def add(self, tdef, dscfg, pstate=None, initialdlstatus=None, setupDelay=0, hidd # Store in list of Downloads, always. self.downloads[infohash] = d - setup_deferred = d.setup(dscfg, pstate, initialdlstatus, wrapperDelay=setupDelay, share_mode=share_mode) + setup_deferred = d.setup(dscfg, pstate, initialdlstatus, wrapperDelay=setupDelay, + share_mode=share_mode, checkpoint_disabled=checkpoint_disabled) setup_deferred.addCallback(self.on_download_wrapper_created) if d and not hidden and self.session.get_megacache(): @@ -532,7 +533,9 @@ def checkpoint(self, stop=False, checkpoint=True, gracetime=2.0): # Download, and additions are no problem (just won't be included # in list of states returned via callback. # - dllist = [dl for dl in self.downloads.values() if not dl.checkpoint_disabled] + dllist = self.downloads.values() + self._logger.debug("tlm: checkpointing %s stopping %s", len(dllist), stop) + network_checkpoint_callback_lambda = lambda: self.network_checkpoint_callback(dllist, stop, checkpoint, gracetime) self.threadpool.add_task(network_checkpoint_callback_lambda, 0.0)