Skip to content

Commit 9445af9

Browse files
Merge pull request #155 from scholzj/watch-example-timeout
Add timeout configuration to WatchExample - Closes #150
2 parents 36924c1 + ac9f305 commit 9445af9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/src/main/java/io/kubernetes/client/examples/WatchExample.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@
2222
import io.kubernetes.client.util.Watch;
2323

2424
import java.io.IOException;
25+
import java.util.concurrent.TimeUnit;
2526

2627
/**
2728
* A simple example of how to use Watch API to watch changes in Namespace list.
2829
*/
2930
public class WatchExample {
3031
public static void main(String[] args) throws IOException, ApiException{
3132
ApiClient client = Config.defaultClient();
33+
client.getHttpClient().setReadTimeout(60, TimeUnit.SECONDS);
3234
Configuration.setDefaultApiClient(client);
3335

3436
CoreV1Api api = new CoreV1Api();

0 commit comments

Comments
 (0)