Skip to content

Commit

Permalink
fix(backend): Deployment with amend of previous posts
Browse files Browse the repository at this point in the history
  • Loading branch information
RezaRahemtola committed Nov 9, 2024
1 parent 534668f commit 1635579
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions backend/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ async def update(
channel=config.ALEPH_CHANNEL,
encoding=Encoding.squashfs,
persistent=False,
sync=True,
volumes=[
AlephVolume(
comment="Python packages",
Expand All @@ -214,6 +215,7 @@ async def update(
post_type="amend",
ref=agent.post_hash,
channel=config.ALEPH_CHANNEL,
sync=True,
)
return UpdateAgentResponse(vm_hash=vm_hash)

Expand Down
3 changes: 2 additions & 1 deletion backend/src/utils/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ async def fetch_agents(ids: list[str] | None = None) -> list[FetchedAgent]:
)
)
return [
FetchedAgent(**post.content, post_hash=post.item_hash) for post in result.posts
FetchedAgent(**post.content, post_hash=post.original_item_hash)
for post in result.posts
]


Expand Down
2 changes: 1 addition & 1 deletion backend/src/utils/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ async def upload_file(file: UploadFile, previous_ref: ItemHash | None = None) ->
channel=config.ALEPH_CHANNEL,
guess_mime_type=True,
)
return store_message.item_hash
return previous_ref if previous_ref is not None else store_message.item_hash

0 comments on commit 1635579

Please sign in to comment.