Skip to content

Commit

Permalink
fixed Watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Katzen48 committed Dec 17, 2021
1 parent 28f33ca commit e375ab8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions shared/src/main/java/net/chrotos/ingress/minecraft/Watcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public Watcher(PodRessourceHandler handler) throws IOException {
apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build();
apiClient.setHttpClient(httpClient);

SharedInformerFactory factory = new SharedInformerFactory();
factory = new SharedInformerFactory();
SharedIndexInformer<V1Pod> podInformer = factory.sharedIndexInformerFor(
(CallGeneratorParams params) -> {
return v1Api.listNamespacedPodCall(
Expand Down Expand Up @@ -61,18 +61,16 @@ public void onUpdate(V1Pod oldObj, V1Pod newObj) {
if (!oldStream.findAny().isPresent() && newStream.findAny().isPresent()) {
handler.onEventReceived(newObj, false);
}

if (oldStream.findAny().isPresent() && !newStream.findAny().isPresent()) {
handler.onEventReceived(oldObj, true);
}
}

@Override
public void onDelete(V1Pod obj, boolean deletedFinalStateUnknown) {


handler.onEventReceived(obj, true);
}
public void onDelete(V1Pod obj, boolean deletedFinalStateUnknown) { }
}
);

factory.startAllRegisteredInformers();
}

public void start() {
Expand Down

0 comments on commit e375ab8

Please sign in to comment.