Skip to content

Commit

Permalink
fix(api): auto discovery rules sync
Browse files Browse the repository at this point in the history
  • Loading branch information
pycook committed Jan 14, 2025
1 parent f6de9b4 commit 6a20e2f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmdb-api/api/views/cmdb/auto_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from api.lib.cmdb.search.ci import search as ci_search
from api.lib.decorator import args_required
from api.lib.decorator import args_validate
from api.lib.exception import AbortException
from api.lib.perm.acl.acl import has_perm_from_args
from api.lib.utils import AESCrypto
from api.lib.utils import get_page
Expand Down Expand Up @@ -296,7 +297,10 @@ def get(self):

rules, last_update_at1 = AutoDiscoveryCITypeCRUD.get(None, oneagent_id, oneagent_name, last_update_at)

subnet_scan_rules, last_update_at2 = SubnetManager().scan_rules(oneagent_id, last_update_at)
try:
subnet_scan_rules, last_update_at2 = SubnetManager().scan_rules(oneagent_id, last_update_at)
except AbortException:
subnet_scan_rules, last_update_at2 = [], ""

return self.jsonify(rules=rules,
subnet_scan_rules=subnet_scan_rules,
Expand Down

0 comments on commit 6a20e2f

Please sign in to comment.