Skip to content

Commit 695adee

Browse files
committed
Add missing timer cancel
1 parent a8fc397 commit 695adee

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎src/main/java/nl/kingdev/graphqlclient/Client.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ public void closeClient() {
219219
this.websocketClient.close();
220220
}
221221
this.httpUtil.close();
222+
if(this.resultCache != null) {
223+
this.resultCache.close();
224+
}
222225
}
223226

224227
public String getUri() {

‎src/main/java/nl/kingdev/graphqlclient/util/Cache.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public void run() {
1919
}, 0, 60000);
2020
}
2121

22+
2223
private static class CacheObject<T> {
2324
protected T object;
2425
protected long ttl;
@@ -69,4 +70,9 @@ public T get(String key) {
6970
return null;
7071
}
7172

73+
74+
75+
public void close() {
76+
this.timer.cancel();
77+
}
7278
}

0 commit comments

Comments
 (0)