Skip to content

Commit 22211cf

Browse files
committed
Revert "fix(backend): only sync required branches"
This reverts commit 23ab221. Not sure of the impact of this change (could break features related to repositories). Also, this change is not required for real world usage (syncing a lot of branches between two sync jobs).
1 parent fd7adb8 commit 22211cf

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

backend/infrahub/git/tasks.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,7 @@ async def sync_remote_repositories() -> None:
201201

202202
branches = await client.branch.all()
203203
async with db.start_session() as dbs:
204-
repositories = await get_repositories_commit_per_branch(
205-
db=dbs, kind=InfrahubKind.REPOSITORY, only_sync_with_git=True
206-
)
204+
repositories = await get_repositories_commit_per_branch(db=dbs, kind=InfrahubKind.REPOSITORY)
207205

208206
for repo_name, repository_data in repositories.items():
209207
repository: CoreRepository = repository_data.repository

backend/infrahub/git/utils.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
async def get_repositories_commit_per_branch(
2828
db: InfrahubDatabase,
2929
kind: str = InfrahubKind.GENERICREPOSITORY,
30-
only_sync_with_git: bool = False,
3130
) -> dict[str, RepositoryData]:
3231
"""Get a list of all repositories and their commit on each branches.
3332
@@ -39,9 +38,6 @@ async def get_repositories_commit_per_branch(
3938
repositories: dict[str, RepositoryData] = {}
4039

4140
for branch in list(registry.branch.values()):
42-
if only_sync_with_git and not branch.sync_with_git:
43-
continue
44-
4541
repos: list[CoreRepository | CoreReadOnlyRepository] = await NodeManager.query(
4642
db=db,
4743
branch=branch,

0 commit comments

Comments
 (0)