Skip to content

Commit

Permalink
fix: remove unecessary duplicate function
Browse files Browse the repository at this point in the history
not required metadata_delegation function was deleted

Signed-off-by: Kairo de Araujo <[email protected]>
  • Loading branch information
kairoaraujo committed Sep 13, 2024
1 parent 9c08036 commit 2de5ee7
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions repository_service_tuf_api/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,46 +133,6 @@ class MetadataDelegationDeletePayload(BaseModel):

delegations: DelegationsData


def metadata_delegation(
payload: MetadataDelegationsPayload | MetadataDelegationDeletePayload,
action: str,
):
bs_state = bootstrap_state()
if bs_state.bootstrap is False:
raise HTTPException(
status.HTTP_200_OK,
detail={
"message": "Task not accepted.",
"error": (
f"Requires bootstrap finished. State: {bs_state.state}"
),
},
)

task_id = get_task_id()
worker_payload = payload.model_dump(by_alias=True, exclude_none=True)
worker_payload["action"] = action

repository_metadata.apply_async(
kwargs={
"action": "metadata_delegation",
"payload": worker_payload,
},
task_id=task_id,
queue="metadata_repository",
acks_late=True,
)

message = f"Metadata delegation {action} accepted."
data = {
"task_id": task_id,
"last_update": datetime.now(timezone.utc),
}

return MetadataPostResponse(data=data, message=message)


#
# Metadata Online Bump
#
Expand Down

0 comments on commit 2de5ee7

Please sign in to comment.