mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-27 18:40:36 +00:00
Fix saving ratios on quit.
This commit is contained in:
parent
3857a564a1
commit
efead335a9
11
src/core.py
11
src/core.py
@ -360,14 +360,13 @@ class Manager:
|
|||||||
|
|
||||||
def pickle_state(self):
|
def pickle_state(self):
|
||||||
print "save uploaded memory"
|
print "save uploaded memory"
|
||||||
for unique_ID in self.unique_IDs.keys():
|
for torrent in self.state.torrents:
|
||||||
# self.get_core_torrent_state purposefully not cached.
|
uid = self.state.torrents[torrent]
|
||||||
try:
|
try:
|
||||||
self.unique_IDs[unique_ID].uploaded_memory = \
|
torrent.uploaded_memory = self.unique_IDs[uid].uploaded_memory +\
|
||||||
self.unique_IDs[unique_ID].initial_uploaded_memory + \
|
self.get_core_torrent_state(uid, False)['total_upload']
|
||||||
self.get_core_torrent_state(unique_ID, False)['total_upload']
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
self.unique_IDs[unique_ID].initial_uploaded_memory = 0
|
torrent.uploaded_memory = 0
|
||||||
# Pickle the state so if we experience a crash, the latest state is
|
# Pickle the state so if we experience a crash, the latest state is
|
||||||
# available
|
# available
|
||||||
print "Pickling state..."
|
print "Pickling state..."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user