From 014ce2f12dbcf0deadf472eaeb9f45e78c276fa1 Mon Sep 17 00:00:00 2001 From: Ardhi Putra Pratama H Date: Tue, 20 Dec 2016 11:16:35 +0100 Subject: [PATCH] Fix publish swarm if its joined any community already --- experiments/tribler/channel_download.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/experiments/tribler/channel_download.py b/experiments/tribler/channel_download.py index edee664f9..fd7a0fe86 100755 --- a/experiments/tribler/channel_download.py +++ b/experiments/tribler/channel_download.py @@ -262,7 +262,10 @@ def publish(self, filename, size): elif self.joined_community: self.joined_community._disp_create_torrent_from_torrentdef(tdef, int(time.time())) - self.setup_seeder(filename, size) + self.setup_seeder(filename, size) + else: + self._logger.debug("Can't publish yet, no channel or community joined") + reactor.callLater(10.0, self.publish, filename, size) def _create_test_torrent(self, filename='', size=0): filepath = path.join(self.upload_dir_path, "%s.data" % filename) @@ -330,7 +333,7 @@ def start_download(self, name): 'ChannelTorrents.dispersy_id', 'ChannelTorrents.name', 'Torrent.name', 'ChannelTorrents.description', 'ChannelTorrents.time_stamp', 'ChannelTorrents.inserted'] infohash_bin = None - torrent_values = self.joined_community._channelcast_db.getTorrentsFromChannelId(self.joined_community.get_channel_id(), True, CHANTOR_DB, 5) + torrent_values = self.joined_community._channelcast_db.getTorrentsFromChannelId(self.joined_community.get_channel_id(), True, CHANTOR_DB) if torrent_values: log = "Channel id %s : " % self.joined_community.get_channel_id() for t in torrent_values: