Skip to content

Commit

Permalink
Add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
ugyballoons committed Sep 3, 2024
1 parent 16419af commit d7e3230
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 19 additions & 0 deletions python/lsst/ts/rubintv/background/currentpoller.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ async def clear_todays_data(self) -> None:
self._night_reports = {}

async def check_for_empty_per_day_channels(self) -> None:
"""Creates a store of channel prefixes for per-day data that's not
been received over the course of a day's polling. The prefixes use the
date that's been rolled over from, i.e. yesterday's date, to continue
to look for that data into the new day.
"""
for location in self.locations:
# clear out yesterday's stash
self._yesterday_prefixes[location.name] = []
Expand Down Expand Up @@ -123,6 +128,20 @@ async def poll_buckets_for_todays_data(self, test_day: str = "") -> None:
logger.exception("Caught exception during poll for data")

async def poll_for_yesterdays_per_day(self, location: Location) -> None:
"""Uses the store of prefixes for yesterday's missing per-day data to
poll for new objects that have maybe been delayed in processing (this
will mainly be movies) and didn't appear in the bucket before the day
rolled over.
Multiple objects will be ignored except for the most recent.
If an object is found in the bucket, the current page is notified.
Note: This does not effect historical pages.
Parameters
----------
location : Location
A given location.
"""
client = self._s3clients[location.name]
found = []
for prefix in self._yesterday_prefixes.get(location.name, []):
Expand Down
1 change: 0 additions & 1 deletion tests/background/currentpoller_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ async def test_poll_buckets_for_today_process_and_store_seq_events(
await current_poller.poll_buckets_for_todays_data()

mocked_objs_keys = rubin_data_mocker.events.keys()
print(mocked_objs_keys)

# make sure the keys for the location/cameras match up
current_keys = sorted([k for k in current_poller._events.keys()])
Expand Down

0 comments on commit d7e3230

Please sign in to comment.