mirror of
https://github.com/codex-storage/deluge.git
synced 2025-03-01 19:40:39 +00:00
only try to fix dht corruption once
This commit is contained in:
parent
575c6f5e4f
commit
54a61c8695
@ -142,6 +142,7 @@ class DelugeGTK:
|
|||||||
signal.signal(signal.SIGTERM, self.manager.quit)
|
signal.signal(signal.SIGTERM, self.manager.quit)
|
||||||
signal.signal(signal.SIGHUP, self.manager.quit)
|
signal.signal(signal.SIGHUP, self.manager.quit)
|
||||||
self.dht_timer = 0
|
self.dht_timer = 0
|
||||||
|
self.dht_skip = False
|
||||||
|
|
||||||
def connect_signals(self):
|
def connect_signals(self):
|
||||||
self.wtree.signal_autoconnect({
|
self.wtree.signal_autoconnect({
|
||||||
@ -973,14 +974,12 @@ class DelugeGTK:
|
|||||||
dht_peers = '?'
|
dht_peers = '?'
|
||||||
if dht_peers == 0:
|
if dht_peers == 0:
|
||||||
self.dht_timer += 1
|
self.dht_timer += 1
|
||||||
if (self.dht_timer == 15) and (self.manager.get_state()['num_peers'] > 0):
|
if (self.dht_timer == 20) and (self.manager.\
|
||||||
#dht has been on for 15 seconds but has 0 nodes
|
get_state()['num_peers'] > 0) and (not self.dht_skip):
|
||||||
#we probably have a corrupted dht.state file,
|
|
||||||
#so let's clean things up
|
|
||||||
self.manager.set_DHT(False)
|
self.manager.set_DHT(False)
|
||||||
os.remove(common.CONFIG_DIR + '/dht.state')
|
os.remove(common.CONFIG_DIR + '/dht.state')
|
||||||
self.manager.set_DHT(True)
|
self.manager.set_DHT(True)
|
||||||
self.dht_timer = 0
|
self.dht_skip = True
|
||||||
else:
|
else:
|
||||||
dht_peers = str(dht_peers)
|
dht_peers = str(dht_peers)
|
||||||
self.statusbar_temp_msg = self.statusbar_temp_msg + \
|
self.statusbar_temp_msg = self.statusbar_temp_msg + \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user