fix(tools-pve/asr-pipeline): mount gitea ssh key for Obsidian vault sync and fix provider source_detail
This commit is contained in:
@@ -1808,9 +1808,10 @@ class Handler(BaseHTTPRequestHandler):
|
||||
return self.redirect("/lexicon?tab=relations&msg=" + urllib.parse.quote(f"已删除关系:{old_s} {old_p} {old_o}"))
|
||||
|
||||
if path == "/lexicon/sync":
|
||||
p_res = vault.pull()
|
||||
l_res = lexicon.sync_from_vault(force=True)
|
||||
g_res = graph.sync(force=True)
|
||||
return self.redirect("/lexicon?msg=" + urllib.parse.quote(f"同步完成:词库 {l_res},图谱 {g_res}"))
|
||||
return self.redirect("/lexicon?msg=" + urllib.parse.quote(f"同步完成(Git:{p_res}):词库 {l_res},图谱 {g_res}"))
|
||||
|
||||
# ---- SQLite Settings Save ----
|
||||
if path == "/settings":
|
||||
|
||||
@@ -191,13 +191,14 @@ def scan_inbox() -> None:
|
||||
process_audio(source, job)
|
||||
except Exception as exc:
|
||||
attempts = int((db.get_job(job["id"]) or {}).get("attempts") or 0)
|
||||
retry = attempts < MAX_ATTEMPTS
|
||||
is_empty_audio = isinstance(exc, providers.EmptyAudioError)
|
||||
retry = (attempts < MAX_ATTEMPTS) and not is_empty_audio
|
||||
db.update_job(
|
||||
job["id"], "queued" if retry else "failed",
|
||||
f"处理失败,等待重试 ({exc})" if retry else f"处理失败:{exc}",
|
||||
error_code=type(exc).__name__,
|
||||
)
|
||||
log(f"job={job['id']} failed type={type(exc).__name__} err={exc}")
|
||||
log(f"job={job['id']} failed type={type(exc).__name__} retry={retry} err={exc}")
|
||||
target = INBOX / source.name if retry else FAILED / source.name
|
||||
if source.exists():
|
||||
shutil.move(str(source), target)
|
||||
@@ -255,6 +256,7 @@ def recover() -> None:
|
||||
|
||||
def sync_vault_knowledge() -> None:
|
||||
try:
|
||||
vault.pull()
|
||||
lexicon.sync_from_vault()
|
||||
graph.sync()
|
||||
except Exception as exc:
|
||||
|
||||
Reference in New Issue
Block a user