Skip to content

Commit 502682e

Browse files
committed
fix: [analyst-data:pull] Return early if there is nothing to pull
1 parent c33a877 commit 502682e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app/Model/AnalystData.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,9 @@ public function pull(array $user, ServerSyncTool $serverSync)
907907
}
908908

909909
$allRemoteUUIDs = [];
910+
if (empty($remoteData)) {
911+
return 0;
912+
}
910913
foreach (self::ANALYST_DATA_TYPES as $type) {
911914
$allRemoteUUIDs = array_merge($allRemoteUUIDs, array_keys($remoteData[$type]));
912915
}

tests/testlive_sync.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ def check_response(response):
8787
url = f'servers/pull/{remote_server["id"]}/disable_background_processing:1'
8888
pull_response = pymisp._check_response(pymisp._prepare_request('GET', url))
8989
check_response(pull_response)
90-
print(pull_response)
9190
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"]
9291

9392
# Test pull background

0 commit comments

Comments
 (0)