feat: Adjust connect to live room interval support
This commit is contained in:
parent
dc9e2bdf48
commit
55ce0f3128
@ -111,10 +111,11 @@ class StarBot:
|
||||
await redis.set_live_start_time(up.room_id, start_time)
|
||||
|
||||
# 连接直播间
|
||||
interval = config.get("CONNECTION_INTERVAL")
|
||||
for up in self.__datasource.get_up_list():
|
||||
try:
|
||||
await up.connect()
|
||||
await asyncio.sleep(0.2)
|
||||
await asyncio.sleep(interval)
|
||||
except LiveException as ex:
|
||||
logger.error(ex.msg)
|
||||
if len(self.__datasource.get_up_list()) > 0:
|
||||
|
@ -44,6 +44,8 @@ SIMPLE_CONFIG = {
|
||||
# 是否将日志同时输出到文件中
|
||||
"LOG_TO_FILE": False,
|
||||
|
||||
# 连接每个直播间的间隔等待时长,用于避免连接大量直播间时的并发过多异常 too many file descriptors in select(),单位:秒
|
||||
"CONNECTION_INTERVAL": 0.2,
|
||||
# 成功连接所有主播直播间的最大等待时长,可使得日志输出顺序更加易读,一般无需修改此处,设置为 0 会自适应计算,单位:秒
|
||||
"WAIT_FOR_ALL_CONNECTION_TIMEOUT": 0,
|
||||
|
||||
@ -160,6 +162,8 @@ FULL_CONFIG = {
|
||||
# 是否将日志同时输出到文件中
|
||||
"LOG_TO_FILE": False,
|
||||
|
||||
# 连接每个直播间的间隔等待时长,用于避免连接大量直播间时的并发过多异常 too many file descriptors in select(),单位:秒
|
||||
"CONNECTION_INTERVAL": 0.2,
|
||||
# 成功连接所有主播直播间的最大等待时长,可使得日志输出顺序更加易读,一般无需修改此处,设置为 0 会自适应计算,单位:秒
|
||||
"WAIT_FOR_ALL_CONNECTION_TIMEOUT": 0,
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user