Skip to content

Commit

Permalink
Set timeout seconds to 20s and set resource version for stream reconn…
Browse files Browse the repository at this point in the history
…ection.
  • Loading branch information
stefanhellander committed Apr 17, 2024
1 parent 7523037 commit 0b98e41
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion event_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,17 @@ def sync_all_statuses():


def init_event_listener():
resource_version = ""
for event in w.stream(
api.list_namespaced_pod,
namespace=namespace,
label_selector=label_selector,
timeout_seconds=0,
timeout_seconds=20,
resource_version=resource_version,
):
pod = event["object"]

resource_version = pod.metadata.resource_version
status = get_status(pod)

logging.info(f"Synchronizing status: {status}")
Expand Down

0 comments on commit 0b98e41

Please sign in to comment.