fix: [analyst-data:pull] Return early if there is nothing to pull

notes
Sami Mokaddem 2024-02-15 15:21:00 +01:00
parent c33a8774a8
commit 502682ee51
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
2 changed files with 3 additions and 1 deletions

View File

@ -907,6 +907,9 @@ class AnalystData extends AppModel
}
$allRemoteUUIDs = [];
if (empty($remoteData)) {
return 0;
}
foreach (self::ANALYST_DATA_TYPES as $type) {
$allRemoteUUIDs = array_merge($allRemoteUUIDs, array_keys($remoteData[$type]));
}

View File

@ -87,7 +87,6 @@ assert event_preview["Event"]["uuid"] == event.uuid
url = f'servers/pull/{remote_server["id"]}/disable_background_processing:1'
pull_response = pymisp._check_response(pymisp._prepare_request('GET', url))
check_response(pull_response)
print(pull_response)
assert "Pull completed. 0 events pulled, 0 events could not be pulled, 0 proposals pulled, 0 sightings pulled, 0 clusters pulled, 0 analyst data pulled." == pull_response["message"], pull_response["message"]
# Test pull background