mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-10-25 17:36:29 +08:00
fix(web): restore app_module lookup in channel _do_stop
PR #3141 dropped the sys/app_module definition in the disconnect path's _do_stop while switching to _live_channel_manager(), but the next line still reads _clear_singleton_cache off app_module. That raised NameError (swallowed by the except), so the singleton cache was never cleared on disconnect. Restore the app_module lookup so cleanup runs again. Co-authored-by: cowagent <cow@cowagent.ai>
This commit is contained in:
1 parent
8cb998270b
commit
61ee3bcbcd
1 file changed
+2
@@ -5893,6 +5893,8 @@ class ChannelsHandler:
|
||||
|
||||
def _do_stop():
|
||||
try:
|
||||
import sys
|
||||
app_module = sys.modules.get('__main__') or sys.modules.get('app')
|
||||
mgr = _live_channel_manager()
|
||||
clear_fn = getattr(app_module, '_clear_singleton_cache', None) if app_module else None
|
||||
if mgr:
|
||||
|
||||
Reference in new issue
Block a user