mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
bridgev2/commands: add debug command for resetting connections
This commit is contained in:
parent
75f9cb369b
commit
34bcd027e5
2 changed files with 24 additions and 1 deletions
|
|
@ -101,3 +101,25 @@ var CommandSendAccountData = &FullHandler{
|
|||
RequiresPortal: true,
|
||||
RequiresLogin: true,
|
||||
}
|
||||
|
||||
var CommandResetNetwork = &FullHandler{
|
||||
Func: func(ce *Event) {
|
||||
if strings.Contains(strings.ToLower(ce.RawArgs), "--reset-transport") {
|
||||
nrn, ok := ce.Bridge.Network.(bridgev2.NetworkResettingNetwork)
|
||||
if ok {
|
||||
nrn.ResetHTTPTransport()
|
||||
} else {
|
||||
ce.Reply("Network connector does not support resetting HTTP transport")
|
||||
}
|
||||
}
|
||||
ce.Bridge.ResetNetworkConnections()
|
||||
ce.React("✅️")
|
||||
},
|
||||
Name: "debug-reset-network",
|
||||
Help: HelpMeta{
|
||||
Section: HelpSectionAdmin,
|
||||
Description: "Reset network connections to the remote network",
|
||||
Args: "[--reset-transport]",
|
||||
},
|
||||
RequiresAdmin: true,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@ func NewProcessor(bridge *bridgev2.Bridge) bridgev2.CommandProcessor {
|
|||
}
|
||||
proc.AddHandlers(
|
||||
CommandHelp, CommandCancel,
|
||||
CommandRegisterPush, CommandSendAccountData, CommandDeletePortal, CommandDeleteAllPortals, CommandSetManagementRoom,
|
||||
CommandRegisterPush, CommandSendAccountData, CommandResetNetwork,
|
||||
CommandDeletePortal, CommandDeleteAllPortals, CommandSetManagementRoom,
|
||||
CommandLogin, CommandRelogin, CommandListLogins, CommandLogout, CommandSetPreferredLogin,
|
||||
CommandSetRelay, CommandUnsetRelay,
|
||||
CommandResolveIdentifier, CommandStartChat, CommandCreateGroup, CommandSearch, CommandSyncChat, CommandMute,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue