Skip to content

Commit

Permalink
readd share_mode and disabled_checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ardhipoetra committed Apr 25, 2016
1 parent c3538bd commit 1d1f3b1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Tribler/Core/APIImplementation/LaunchManyCore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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():
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1d1f3b1

Please sign in to comment.