mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-31 12:52:13 +00:00
fix(recommendations): Check whether an entity exists before recommending (#5163)
This commit is contained in:
parent
66b9676567
commit
0c619ff393
@ -74,10 +74,15 @@ public class EntityUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if entity is removed (removed=true in Status aspect)
|
||||
* Check if entity is removed (removed=true in Status aspect) and exists
|
||||
*/
|
||||
public static boolean checkIfRemoved(EntityService entityService, Urn entityUrn) {
|
||||
try {
|
||||
|
||||
if (!entityService.exists(entityUrn)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
EnvelopedAspect statusAspect =
|
||||
entityService.getLatestEnvelopedAspect(entityUrn.getEntityType(), entityUrn, "status");
|
||||
if (statusAspect == null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user