mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-19 22:58:30 +00:00
Fix mistake in torrentmanager
This commit is contained in:
parent
5ae74f4017
commit
45f898870f
@ -147,6 +147,7 @@ class TorrentManager(component.Component):
|
|||||||
self.state_dir = os.path.join(get_config_dir(), "state")
|
self.state_dir = os.path.join(get_config_dir(), "state")
|
||||||
if not os.path.exists(self.state_dir):
|
if not os.path.exists(self.state_dir):
|
||||||
os.makedirs(self.state_dir)
|
os.makedirs(self.state_dir)
|
||||||
|
self.temp_file = os.path.join(self.state_dir, ".safe_state_check")
|
||||||
|
|
||||||
# Create the torrents dict { torrent_id: Torrent }
|
# Create the torrents dict { torrent_id: Torrent }
|
||||||
self.torrents = {}
|
self.torrents = {}
|
||||||
@ -213,13 +214,12 @@ class TorrentManager(component.Component):
|
|||||||
# Get the pluginmanager reference
|
# Get the pluginmanager reference
|
||||||
self.plugins = component.get("CorePluginManager")
|
self.plugins = component.get("CorePluginManager")
|
||||||
|
|
||||||
# Check for temp file
|
# Check for old temp file to verify safe shutdown
|
||||||
self.temp_file = os.path.join(self.state_dir, ".safe_state_check")
|
|
||||||
if os.path.isfile(self.temp_file):
|
if os.path.isfile(self.temp_file):
|
||||||
def archive_file(filename):
|
def archive_file(filename):
|
||||||
import datetime
|
import datetime
|
||||||
filepath = os.path.join(self.state_dir, filename)
|
filepath = os.path.join(self.state_dir, filename)
|
||||||
filepath_bak = state_filepath + ".bak"
|
filepath_bak = filepath + ".bak"
|
||||||
archive_dir = os.path.join(get_config_dir(), "archive")
|
archive_dir = os.path.join(get_config_dir(), "archive")
|
||||||
if not os.path.exists(archive_dir):
|
if not os.path.exists(archive_dir):
|
||||||
os.makedirs(archive_dir)
|
os.makedirs(archive_dir)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user