Skip to content
Snippets Groups Projects
Commit 6e5830d1 authored by Jan David Mol's avatar Jan David Mol
Browse files

Fix for parsing generator

parent cbadb0e1
No related branches found
No related tags found
No related merge requests found
Pipeline #89439 passed
Pipeline: Stingray

#89440

    ......@@ -12,6 +12,7 @@ from datetime import datetime, timedelta
    import time
    from minio import Minio
    import minio.datatypes
    logger = logging.getLogger()
    ......@@ -42,18 +43,20 @@ class S3PacketLoader: # pylint: disable=too-few-public-methods
    self.prefix = prefix.strip("/")
    self.block_duration = block_duration
    def _list_objects_after(self, timestamp: datetime) -> list:
    def _list_objects_after(self, timestamp: datetime) -> list[minio.datatypes.Object]:
    """Return a list of objects that (should) contain packets of and after
    the given timestamp."""
    # NB: The timestamp in the filename is the time when the file was
    # completed, so after the last timestamp recorded in the file.
    return self._minio_client.list_objects(
    self.bucket,
    recursive=True,
    prefix=f"{self.prefix}",
    start_after=f"{self.prefix}/{timestamp.year}/{timestamp.month:02d}/"
    f"{timestamp.day:02d}/{timestamp.isoformat()}.json",
    return list(
    self._minio_client.list_objects(
    self.bucket,
    recursive=True,
    prefix=f"{self.prefix}",
    start_after=f"{self.prefix}/{timestamp.year}/{timestamp.month:02d}/"
    f"{timestamp.day:02d}/{timestamp.isoformat()}.json",
    )
    )
    def wait_for_packets(self, timestamp: datetime) -> bool:
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment