Skip to content

Commit

Permalink
fix fabric8io#4408: deprecating addSharedInformerEventListener
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Oct 11, 2022
1 parent 4d38731 commit 7f3a010
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Expand Up @@ -175,7 +175,7 @@ default boolean hasSynced() {

/**
* Sets the {@link ExceptionHandler} for this informer. For example, exceptionHandler((b, t) -> true)), will
* keep retying no matter what the exception is.
* keep retrying no matter what the exception is.
* <p>
* May only be called prior to the informer starting
*
Expand Down
Expand Up @@ -81,6 +81,11 @@ <T extends HasMetadata> SharedIndexInformer<T> sharedIndexInformerFor(Class<T> a
*/
void stopAllRegisteredInformers();

/**
* @deprecated
* @see the {@link SharedIndexInformer#stopped()} method to get notified when an informer stops.
*/
@Deprecated
void addSharedInformerEventListener(SharedInformerEventListener event);

}
Expand Up @@ -56,8 +56,11 @@ public void onDelete(Dummy pod, boolean deletedFinalStateUnknown) {
}
});

sharedInformerFactory
.addSharedInformerEventListener(ex -> logger.error("Exception occurred, but caught: {}", ex.getMessage()));
podInformer.stopped().whenComplete((v, t) -> {
if (t != null) {
logger.error("Exception occurred, caught: {}", t.getMessage());
}
});

logger.info("Starting all registered informers");
sharedInformerFactory.startAllRegisteredInformers();
Expand Down

0 comments on commit 7f3a010

Please sign in to comment.