From d8ff2c92ea58a0ea81a80520f597d432dc911069 Mon Sep 17 00:00:00 2001 From: Martyn Smith Date: Tue, 18 Jul 2017 16:15:28 +1200 Subject: [PATCH] Don't use exhausted nextToken It seems the AWS API changed so that if you specify a nextToken that you've already used, you don't actually get new results (and a new nextToken). This patch simply drops the nextToken from the request after it's been used (which appears to fix the `--watch` behaviour at least for me). --- awslogs/core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/awslogs/core.py b/awslogs/core.py index 7936f33..0ded50c 100644 --- a/awslogs/core.py +++ b/awslogs/core.py @@ -131,6 +131,8 @@ def generator(): if 'nextToken' in response: kwargs['nextToken'] = response['nextToken'] else: + # No more results for this token, don't try to use it again + kwargs.pop('nextToken', None) yield do_wait def consumer():