change: 优化helm chart的k8s-init.sh和core-webui-cm-sync.py的输出
This commit is contained in:
@@ -43,8 +43,8 @@ class ConfigObserverHandler(FileSystemEventHandler):
|
||||
"""配置文件变化的事件处理器"""
|
||||
def on_modified(self, event):
|
||||
if os.path.abspath(event.src_path) in target_files:
|
||||
print(
|
||||
f'[{datetime.now().strftime("%Y-%m-%d %H:%M:%S")}] File `{event.src_path}` was modified. Start to sync...')
|
||||
print(f'[{datetime.now().strftime("%Y-%m-%d %H:%M:%S")}] File `{event.src_path}` was modified. '
|
||||
f'Start to sync...')
|
||||
with open(event.src_path, "r", encoding="utf-8") as _f:
|
||||
current_data = _f.read()
|
||||
new_cm = {
|
||||
@@ -52,6 +52,7 @@ class ConfigObserverHandler(FileSystemEventHandler):
|
||||
}
|
||||
try:
|
||||
set_configmap(new_cm)
|
||||
print(f'\tSync done.')
|
||||
except client.exceptions.ApiException as _e:
|
||||
print(f'\tError while setting configmap:\n'
|
||||
f'\t\tStatus Code: {_e.status}\n'
|
||||
|
||||
@@ -16,7 +16,7 @@ mkdir -p /MaiMBot/data/plugins
|
||||
mkdir -p /MaiMBot/data/logs
|
||||
if [ ! -d "/MaiMBot/statistics" ]
|
||||
then
|
||||
echo "[K8s Init] Statistics volume disabled."
|
||||
echo "[K8s Init] Statistics volume is disabled."
|
||||
else
|
||||
touch /MaiMBot/statistics/index.html
|
||||
fi
|
||||
@@ -47,7 +47,7 @@ then
|
||||
ln -s /MaiMBot/webui-cm-sync/bot_config.toml /MaiMBot/config/bot_config.toml
|
||||
echo "[K8s Init] Config files middle layer for WebUI created."
|
||||
else
|
||||
echo "[K8s Init] WebUI disabled."
|
||||
echo "[K8s Init] WebUI is disabled."
|
||||
fi
|
||||
|
||||
# 启动麦麦
|
||||
|
||||
Reference in New Issue
Block a user