1
0

more fine grained transactions in EGG:RemoteSource:update
All checks were successful
Build Docker and Deploy / Build Docker (push) Successful in 19s
Build Docker and Deploy / Deploy to Server (push) Successful in 16s

This commit is contained in:
Mike Schwörer 2025-07-14 09:47:41 +02:00
parent e5c9b1c2a0
commit d57682a924
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF

View File

@ -57,40 +57,46 @@ abstract class StandardGitConnection implements IRemoteSource
foreach ($repos as $repo) foreach ($repos as $repo)
{ {
$db->beginTransaction(); $branches = $this->listAndUpdateBranches($db, $repo);
{ $this->logger->proclog("Found " . count($branches) . " nin Repo: [" . $repo->Name . "]");
$branches = $this->listAndUpdateBranches($db, $repo);
$db->setUpdateDateOnRepository($repo);
$repo_changed = false; foreach ($branches as $branch)
foreach ($branches as $branch) {
{
if ($branch->HeadFromAPI === $branch->Head)
{
$db->setUpdateDateOnBranch($branch);
$this->logger->proclog("Branch: [" . $this->name . "|" . $repo->Name . "|" . $branch->Name . "] is up to date");
continue;
}
$updateCount = $this->listAndUpdateCommits($db, $repo, $branch); $db->beginTransaction();
$db->setUpdateDateOnBranch($branch); {
if ($updateCount === 0) if ($branch->HeadFromAPI === $branch->Head)
{ {
$this->logger->proclog("Branch: [" . $this->name . "|" . $repo->Name . "|" . $branch->Name . "] has no new commits"); $db->setUpdateDateOnBranch($branch);
continue; $this->logger->proclog("Branch: [" . $this->name . "|" . $repo->Name . "|" . $branch->Name . "] is up to date");
} $db->commitTransaction();
continue;
}
$this->logger->proclog("Found " . $updateCount . " new commits in Branch: [" . $this->name . "|" . $repo->Name . "|" . $branch->Name . "]"); $updateCount = $this->listAndUpdateCommits($db, $repo, $branch);
$db->setUpdateDateOnBranch($branch);
if ($updateCount === 0)
{
$this->logger->proclog("Branch: [" . $this->name . "|" . $repo->Name . "|" . $branch->Name . "] has no new commits");
$db->commitTransaction();
continue;
}
$repo_changed = true; $this->logger->proclog("Found " . $updateCount . " new commits in Branch: [" . $this->name . "|" . $repo->Name . "|" . $branch->Name . "]");
$db->setChangeDateOnBranch($branch);
}
if ($repo_changed) $db->setChangeDateOnRepository($repo); $anyChanged = true;
if ($repo_changed) $anyChanged = true;
}
$db->commitTransaction(); $db->setChangeDateOnBranch($branch);
$db->setChangeDateOnRepository($repo);
$db->setUpdateDateOnRepository($repo);
}
$db->commitTransaction();
}
$db->beginTransaction();
$db->setUpdateDateOnRepository($repo);
$db->commitTransaction();
} }
if ($anyChanged) if ($anyChanged)