Skip to content

Commit

Permalink
Removed Unfinished Features
Browse files Browse the repository at this point in the history
  • Loading branch information
Edbo849 committed Sep 2, 2024
1 parent 999c530 commit ddedf86
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 43 deletions.
10 changes: 0 additions & 10 deletions esgf-consumer/esgf_consumer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
create_item,
hard_delete_item,
update_item,
soft_delete_item,
)
from esgf_consumer.producers import get_producer

Expand Down Expand Up @@ -176,15 +175,6 @@ async def _handle_message(
)
logger.critical("Item %s deleted.", event.data.payload.item_id)

case RevokePayload(method="PATCH"):
await soft_delete_item(
event.data.payload.collection_id,
event.data.payload.item_id,
settings,
client,
)
logger.critical("Item %s deleted.", event.data.payload.item_id)

case _:
raise ESGFConsumerUnknownPayloadError

Expand Down
24 changes: 0 additions & 24 deletions esgf-consumer/esgf_consumer/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,30 +45,6 @@ async def update_item(
return None


async def soft_delete_item(
collection_id: str,
item: Item,
item_id: str,
settings: Settings,
client: httpx.AsyncClient,
) -> None:

path = f"collections/{collection_id}/items/{item_id}"
url = urljoin(str(settings.stac_server), path)

patch_data = {"retracted": True}

logger.critical("Revoking %s at %s", getattr(item.properties, "instance_id"), url)
result = await client.patch(url, content=patch_data, timeout=5)
if result.status_code < 300:
logger.critical("Item Revoked")

else:
logger.critical("Item not revoked: %s", result.content)

return None


async def hard_delete_item(
collection_id: str, item_id: str, settings: Settings, client: httpx.AsyncClient
) -> None:
Expand Down
9 changes: 0 additions & 9 deletions esgf-transaction-api/esgf_transaction_api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,6 @@ async def modify_item(collection_id: str, item: Item, item_id: str) -> None:
await post_message(event)


# Not Yet Implemented
# async def revoke_item_soft(collection_id: str, item_id: str) -> None:
# payload = RevokePayload(
# method="PATCH", collection_id=collection_id, item_id=item_id
# )
# event = item_body(payload)
# await post_message(event)


async def revoke_item_hard(collection_id: str, item_id: str) -> None:
payload = RevokePayload(
method="DELETE", collection_id=collection_id, item_id=item_id
Expand Down

0 comments on commit ddedf86

Please sign in to comment.