perf: 优化 xpack license 检查 (#11885)

Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
fit2bot
2023-10-18 14:10:24 +08:00
committed by GitHub
parent f088bbce12
commit d3a283232f
10 changed files with 24 additions and 39 deletions

View File

@@ -75,7 +75,7 @@ class NativeClient(TextChoices):
xpack_protocols = Protocol.xpack_protocols()
for protocol, _clients in clients_map.items():
if not settings.XPACK_ENABLED and protocol in xpack_protocols:
if not settings.XPACK_LICENSE_IS_VALID and protocol in xpack_protocols:
continue
if isinstance(_clients, dict):
if os == 'all':
@@ -83,7 +83,7 @@ class NativeClient(TextChoices):
else:
_clients = _clients.get(os, _clients['default'])
for client in _clients:
if not settings.XPACK_ENABLED and client in cls.xpack_methods():
if not settings.XPACK_LICENSE_IS_VALID and client in cls.xpack_methods():
continue
methods[protocol].append({
'value': client.value,