Fix: Recarga en caliente para canales y solución a caché estancado en MySQL

This commit is contained in:
2026-03-20 13:01:26 -06:00
parent 97ce9fce86
commit df56e7d841
5 changed files with 135 additions and 9 deletions

View File

@@ -476,7 +476,9 @@ async def toggle_discord_channel(request: Request):
try:
from botdiscord.database import toggle_channel_status
from botdiscord.reload_marker import set_reload_marker
toggle_channel_status(int(channel_id), is_active)
set_reload_marker()
return RedirectResponse(url="/discord-channels?success=1", status_code=status.HTTP_303_SEE_OTHER)
except Exception as e:
print(f"Error toggling channel: {e}")
@@ -495,7 +497,9 @@ async def delete_discord_server(request: Request):
try:
from botdiscord.database import delete_discord_server
from botdiscord.reload_marker import set_reload_marker
delete_discord_server(int(server_id))
set_reload_marker()
return RedirectResponse(url="/discord-channels?success=1", status_code=status.HTTP_303_SEE_OTHER)
except Exception as e:
print(f"Error deleting server: {e}")
@@ -550,6 +554,8 @@ async def bulk_toggle_discord_channels(request: Request):
continue
print(f"[Panel] Bulk toggle: {success_count} canales {'activados' if is_active else 'desactivados'}")
from botdiscord.reload_marker import set_reload_marker
set_reload_marker()
return RedirectResponse(url="/discord-channels?success=1", status_code=status.HTTP_303_SEE_OTHER)
except Exception as e: