Skip to content

Commit e1fc8dc

Browse files
mvanzaluClemDoum
andcommitted
fix: namespace add custom attributes
Co-authored-by: Clément Doumouro <ClemDoum@users.noreply.github.com>
1 parent 0586491 commit e1fc8dc

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

datashare-tasks/src/main/java/org/icij/datashare/asynctasks/temporal/TemporalInterlocutor.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,18 @@ private static boolean hasNamespace(WorkflowServiceGrpc.WorkflowServiceBlockingS
166166

167167
private static boolean namespaceIsReady(OperatorServiceGrpc.OperatorServiceBlockingStub operatorServiceBlockingStub,
168168
String namespace) {
169-
Set<String> searchAttributes = operatorServiceBlockingStub
170-
.listSearchAttributes(ListSearchAttributesRequest.newBuilder().setNamespace(namespace).build())
171-
.getCustomAttributesMap()
172-
.keySet();
169+
Set<String> searchAttributes;
170+
try {
171+
searchAttributes = operatorServiceBlockingStub
172+
.listSearchAttributes(ListSearchAttributesRequest.newBuilder().setNamespace(namespace).build())
173+
.getCustomAttributesMap()
174+
.keySet();
175+
} catch (StatusRuntimeException e) {
176+
if (!e.getStatus().getCode().equals(Status.Code.NOT_FOUND) && !e.getStatus().getCode().equals(Status.Code.FAILED_PRECONDITION)) {
177+
throw e;
178+
}
179+
return false;
180+
}
173181
return searchAttributes.containsAll(CUSTOM_SEARCH_ATTRIBUTES.keySet());
174182
}
175183

0 commit comments

Comments
 (0)