Skip to content

Commit

Permalink
fixup! Fix setup seeder race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
ardhipoetra committed Dec 14, 2016
1 parent 623341b commit 3acb336
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions experiments/tribler/channel_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ def __ds_active_callback(self, ds):
return 1.0, True

def setup_seeder(self, filename, size):
filename = self.id_experiment + "_" + filename
tpath = path.join(self.upload_dir_path, "%s.data" % filename)
exp_filename = self.id_experiment + "_" + filename
tpath = path.join(self.upload_dir_path, "%s.data" % exp_filename)
tdef = None
if path.isfile(tpath):
tpath = path.join(self.upload_dir_path, "%s.torrent" % filename)
tpath = path.join(self.upload_dir_path, "%s.torrent" % exp_filename)

if path.isfile(tpath):
tdef = TorrentDef.load(tpath)
Expand All @@ -241,7 +241,7 @@ def setup_seeder(self, filename, size):
reactor.callLater(10.0, self.setup_seeder, filename, size)
else:
# file not found. In DAS case, this is because the file in another node
tdef = self._create_test_torrent(filename, size)
tdef = self._create_test_torrent(exp_filename, size)

if tdef:
dscfg = DefaultDownloadStartupConfig.getInstance().copy()
Expand Down

0 comments on commit 3acb336

Please sign in to comment.