Skip to content

Commit

Permalink
fix delta_gen not scanning any dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodong-Yang committed Dec 11, 2024
1 parent 2bfcddc commit 7d75521
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/otaclient/create_standby/_delta_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
from queue import Queue
from typing import Any

from ota_metadata.file_table._orm import FileTableRegularFilesORM
from ota_metadata.file_table._orm import (
FileTableNonRegularFilesORM,
FileTableRegularFilesORM,
)
from ota_metadata.legacy.metadata import OTAMetadata
from ota_metadata.legacy.rs_table import (
RSTableORMThreadPool,
Expand Down Expand Up @@ -88,6 +91,10 @@ def __init__(
self._ft_regular_orm = FileTableRegularFilesORM(
ota_metadata.connect_fstable(read_only=True)
)
self._ft_non_regular_orm = FileTableNonRegularFilesORM(
ota_metadata.connect_fstable(read_only=True)
)

# NOTE: we will update the resource table in-place, the
# leftover entries in the db will be the to-be-downloaded resources.
self._rstable_orm = RSTableORMThreadPool(
Expand Down Expand Up @@ -171,7 +178,7 @@ def _check_skip_dir(self, dpath: Path) -> bool:
return dir_depth_exceeded or (
_dpath != CANONICAL_ROOT
and not dir_should_fully_scan
and not self._ft_regular_orm.orm_select_entry(path=_dpath)
and not self._ft_non_regular_orm.orm_select_entry(path=_dpath)
)

# API
Expand Down
1 change: 1 addition & 0 deletions src/otaclient/ota_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ def _execute_update(self):
)

# ------ in-update: calculate delta ------ #
logger.info("start to calculate delta ...")
try:
with TemporaryDirectory(prefix="ota_delta_cal") as _delta_cal_workdir:
delta_calculator = DeltaGenerator(
Expand Down

0 comments on commit 7d75521

Please sign in to comment.