mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-11 20:58:19 +08:00
Opt: Change directories of reload listening
This commit is contained in:
@@ -62,7 +62,7 @@ class AlasManager:
|
||||
return 1
|
||||
elif len(self.log) == 0 or self.log[-1] == "Scheduler stopped.\n":
|
||||
return 2
|
||||
elif self.log[-2].endswith('Update event detected'):
|
||||
elif self.log[-2].endswith('Update event detected\n'):
|
||||
return 4
|
||||
else:
|
||||
return 3
|
||||
@@ -141,7 +141,7 @@ class AlasManager:
|
||||
if not instances:
|
||||
instances = []
|
||||
try:
|
||||
with open('./reloadalas', mode='r') as f:
|
||||
with open('./config/reloadalas', mode='r') as f:
|
||||
for line in f.readlines():
|
||||
line = line.strip()
|
||||
instances.append(AlasManager.get_alas(line))
|
||||
@@ -153,7 +153,7 @@ class AlasManager:
|
||||
alas.start(func='Alas', ev=ev)
|
||||
|
||||
try:
|
||||
os.remove('./reloadalas')
|
||||
os.remove('./config/reloadalas')
|
||||
except:
|
||||
pass
|
||||
logger.info("Start alas complete")
|
||||
|
||||
@@ -234,7 +234,7 @@ class Updater(Config, Installer):
|
||||
|
||||
if updater.update():
|
||||
self.state = 'reload'
|
||||
with open('./reloadalas', mode='w') as f:
|
||||
with open('./config/reloadalas', mode='w') as f:
|
||||
f.writelines(names)
|
||||
from module.webui.app import clearup
|
||||
self._trigger_reload(2)
|
||||
@@ -249,7 +249,7 @@ class Updater(Config, Installer):
|
||||
@staticmethod
|
||||
def _trigger_reload(delay=2):
|
||||
def trigger():
|
||||
with open('./reloadflag', mode='w'):
|
||||
with open('./config/reloadflag', mode='w'):
|
||||
# app ended here and uvicorn will restart whole app
|
||||
pass
|
||||
timer = threading.Timer(delay, trigger)
|
||||
|
||||
Reference in New Issue
Block a user