feat: enhance logging for character updates and voice cache management

This commit is contained in:
2026-04-07 11:38:35 +08:00
parent b395cb0b98
commit a8d6195cdb
3 changed files with 31 additions and 3 deletions

View File

@@ -745,11 +745,13 @@ async def update_character(
if (data.instruct is not None or data.gender is not None) and char.voice_design_id:
voice_design = crud.get_voice_design(db, char.voice_design_id, current_user.id)
logger.info(f"update_character: char_id={char_id}, voice_design_id={char.voice_design_id}, found={voice_design is not None}")
if voice_design:
if data.instruct is not None:
voice_design.instruct = data.instruct
voice_design.voice_cache_id = None
db.commit()
logger.info(f"update_character: cleared voice_cache_id for design {voice_design.id}")
return _char_to_response(char, db)