mirror of
https://github.com/tuna/tunasync.git
synced 2025-04-21 04:42:46 +00:00
bug fix
This commit is contained in:
parent
2a609f6eb7
commit
45b2046dfb
1
.gitignore
vendored
1
.gitignore
vendored
@ -55,3 +55,4 @@ target/
|
|||||||
|
|
||||||
*.swp
|
*.swp
|
||||||
*~
|
*~
|
||||||
|
/examples/tunasync.json
|
||||||
|
@ -233,13 +233,13 @@ class TUNASync(object):
|
|||||||
|
|
||||||
def _reload_mirrors(self, signum, frame, force=False):
|
def _reload_mirrors(self, signum, frame, force=False):
|
||||||
print("reload mirror configs, force restart: {}".format(force))
|
print("reload mirror configs, force restart: {}".format(force))
|
||||||
self._settings.read(self._config_file)
|
|
||||||
|
|
||||||
for section in filter(lambda s: s.startswith("mirror:"),
|
with open(self._config_file) as f:
|
||||||
self._settings.sections()):
|
self._settings = toml.loads(f.read())
|
||||||
|
|
||||||
_, name = section.split(":")
|
for mirror_opt in self._settings["mirrors"]:
|
||||||
newMirCfg = MirrorConfig(self, name, self._settings, section)
|
name = mirror_opt["name"]
|
||||||
|
newMirCfg = MirrorConfig(self, mirror_opt)
|
||||||
|
|
||||||
if name in self._mirrors:
|
if name in self._mirrors:
|
||||||
if newMirCfg.compare(self._mirrors[name]):
|
if newMirCfg.compare(self._mirrors[name]):
|
||||||
@ -265,10 +265,5 @@ class TUNASync(object):
|
|||||||
print("New mirror: {}".format(name))
|
print("New mirror: {}".format(name))
|
||||||
self.run_provider(name)
|
self.run_provider(name)
|
||||||
|
|
||||||
# def config(self, option):
|
|
||||||
# if self._settings is None:
|
|
||||||
# raise TUNASyncException("Config not inited")
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
# vim: ts=4 sw=4 sts=4 expandtab
|
# vim: ts=4 sw=4 sts=4 expandtab
|
||||||
|
Loading…
x
Reference in New Issue
Block a user