Skip to content

Commit

Permalink
Fixing telescope push timestamp check
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcottner committed Dec 19, 2024
1 parent 99b881e commit 7ce1283
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions checks/remotesettings/push_timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@

import websockets

from operator import attrgetter
from telescope.typings import CheckResult
from telescope.utils import utcfromtimestamp, utcnow
from datetime import datetime

from .utils import KintoClient

Expand Down Expand Up @@ -43,6 +45,10 @@ async def get_push_timestamp(uri) -> str:
async def get_remotesettings_timestamp(uri) -> str:
client = KintoClient(server_url=uri)
entries = await client.get_monitor_changes(bust_cache=True)

# sort by timestamp desc as the records are returned by bucket/collection
entries.sort(key=lambda e: e["last_modified"], reverse=True)

# Some collections are excluded (eg. preview)
# https://github.com/mozilla-services/cloudops-deployment/blob/master/projects/kinto/puppet/modules/kinto/templates/kinto.ini.erb
matched = [e for e in entries if "preview" not in e["bucket"]]
Expand Down

0 comments on commit 7ce1283

Please sign in to comment.