server: Make the lag reconnect time configurable.
This commit is contained in:
parent
b844a26c41
commit
0bc297ba94
2 changed files with 11 additions and 2 deletions
|
@ -426,6 +426,16 @@ class MatrixConfig(WeechatConfig):
|
|||
" Inactive users will be removed from the nicklist after a "
|
||||
"day of inactivity."),
|
||||
),
|
||||
Option(
|
||||
"lag_reconnect",
|
||||
"integer",
|
||||
"",
|
||||
5,
|
||||
604800,
|
||||
"90",
|
||||
("Reconnect to the server if the lag is greater than this "
|
||||
"value (in seconds)"),
|
||||
),
|
||||
]
|
||||
|
||||
color_options = [
|
||||
|
|
|
@ -1317,8 +1317,7 @@ def matrix_timer_cb(server_name, remaining_calls):
|
|||
server.lag_done = False
|
||||
W.bar_item_update("lag")
|
||||
|
||||
# TODO print out message, make timeout configurable
|
||||
if server.lag > 300000:
|
||||
if server.lag > G.CONFIG.network.lag_reconnect * 1000:
|
||||
server.disconnect()
|
||||
return W.WEECHAT_RC_OK
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue