EOX GitLab Instance

Commit 9921ce2c authored by Nikola Jankovic's avatar Nikola Jankovic 💻
Browse files

added collection id

added default queue
parent ef686875
Pipeline #22712 passed with stage
in 49 seconds
......@@ -34,6 +34,8 @@ LABEL name="view server harvester" \
WORKDIR /opt/harvester
ENV REDIS_HARVESTER_QUEUE_KEY="harvester_queue"
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
......
......@@ -13,13 +13,20 @@ LOGGER = get_logger(__name__)
class FileMatcherScheme(FileScheme):
def __init__(
self, source: Source, path: str, time_regex: str, id_regex: str, asset_id: str
self,
source: Source,
path: str,
time_regex: str,
id_regex: str,
asset_id: str,
collection_id: str,
):
super().__init__(source)
self.path = path
self.time_regex = re.compile(time_regex)
self.id_regex = re.compile(id_regex)
self.asset_id = asset_id
self.collection_id = collection_id
def harvest(self) -> Iterator[dict]:
LOGGER.info("Starting S3 harvesting")
......@@ -38,7 +45,12 @@ class FileMatcherScheme(FileScheme):
"updated": self.source.stat(path).mtime,
}
item = pystac.Item(
id=id, geometry=None, bbox=None, datetime=dt, properties=properties
id=id,
geometry=None,
bbox=None,
datetime=dt,
properties=properties,
collection=self.collection_id,
)
item.add_asset(self.asset_id, pystac.Asset(self.source.get_link(path)))
return item
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment