perf: 更新发布机的单用户单会话策略

pull/10715/head
Eric 2023-06-14 16:37:30 +08:00 committed by Jiangjie.Bai
parent dd85e2d74f
commit e762a5d8ae
2 changed files with 5 additions and 1 deletions

View File

@ -194,7 +194,7 @@ class Applet(JMSBaseModel):
host = self.select_host(user)
if not host:
return None
host_concurrent = str(host.deploy_options.get('RDS_fSingleSessionPerUser', 0)) == '1'
host_concurrent = str(host.deploy_options.get('RDS_fSingleSessionPerUser', 0)) == '0'
can_concurrent = (self.can_concurrent or self.type == 'web') and host_concurrent
accounts = host.accounts.all().filter(is_active=True, privileged=False)

View File

@ -24,6 +24,10 @@ class DeployOptionsSerializer(serializers.Serializer):
(4, _('Per Session')),
(2, _('Per Device')),
)
# 单用户单会话,
# 默认值为1表示启用状态组策略默认值此时单用户只能有一个会话连接
# 如果改为 0 ,表示禁用状态,此时可以单用户多会话连接
SESSION_PER_USER = (
(0, _("Disabled")),
(1, _("Enabled")),