Skip to content

Commit

Permalink
added file size to namespace archive
Browse files Browse the repository at this point in the history
  • Loading branch information
khoroshevskyi committed Sep 9, 2024
1 parent 1efb3e4 commit 8b43a07
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions pepdbagent/db_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ class TarNamespace(Base):
file_path: Mapped[str] = mapped_column(nullable=False)
creation_date: Mapped[datetime.datetime] = mapped_column(default=deliver_update_date)
number_of_projects: Mapped[int] = mapped_column(default=0)
file_size: Mapped[int] = mapped_column(nullable=False)


class BaseEngine:
Expand Down
1 change: 1 addition & 0 deletions pepdbagent/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ class TarNamespaceModel(BaseModel):
file_path: str
creation_date: datetime.datetime = None
number_of_projects: int = 0
file_size: int = 0


class TarNamespaceModelReturn(BaseModel):
Expand Down
2 changes: 2 additions & 0 deletions pepdbagent/modules/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ def upload_tar_info(self, tar_info: TarNamespaceModel) -> None:
namespace=tar_info.namespace,
creation_date=tar_info.creation_date,
number_of_projects=tar_info.number_of_projects,
file_size=tar_info.file_size,
)
session.add(new_tar)
session.commit()
Expand Down Expand Up @@ -348,6 +349,7 @@ def get_tar_info(self, namespace: str) -> TarNamespaceModelReturn:
file_path=result.file_path,
creation_date=result.creation_date,
number_of_projects=result.number_of_projects,
file_size=result.file_size,
)
)

Expand Down

0 comments on commit 8b43a07

Please sign in to comment.