Skip to content

Commit 0c7c03f

Browse files
committed
pw-poller: make sure we don't double-process the same series
We seem to be fetching the same series multiple times right now. This is likely because PW uses >= for time comparison and we use the date of last fetched event as the since date. Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 5a20de5 commit 0c7c03f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pw_poller.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ def run(self, life) -> None:
197197
json_resp, since = self._pw.get_new_series(since=since)
198198
log(f"Loaded {len(json_resp)} series", "")
199199

200+
# Advance the time by 1 usec, pw does >= for time comparison
201+
since = datetime.datetime.fromisoformat(since)
202+
since += datetime.timedelta(microseconds=1)
203+
since = since.isoformat()
204+
200205
for pw_series in json_resp:
201206
try:
202207
self.process_series(pw_series)

0 commit comments

Comments
 (0)