more fine grained transactions in EGG:RemoteSource:update
This commit is contained in:
parent
e5c9b1c2a0
commit
1410f3b051
20
www/extern/egg/RemoteSource.php
vendored
20
www/extern/egg/RemoteSource.php
vendored
@ -56,14 +56,14 @@ abstract class StandardGitConnection implements IRemoteSource
|
||||
$anyChanged = false;
|
||||
|
||||
foreach ($repos as $repo)
|
||||
{
|
||||
$db->beginTransaction();
|
||||
{
|
||||
$branches = $this->listAndUpdateBranches($db, $repo);
|
||||
$db->setUpdateDateOnRepository($repo);
|
||||
$this->logger->proclog("Found " . count($branches) . " nin Repo: [" . $repo->Name . "]");
|
||||
|
||||
$repo_changed = false;
|
||||
foreach ($branches as $branch)
|
||||
{
|
||||
|
||||
$db->beginTransaction();
|
||||
{
|
||||
if ($branch->HeadFromAPI === $branch->Head)
|
||||
{
|
||||
@ -82,15 +82,15 @@ abstract class StandardGitConnection implements IRemoteSource
|
||||
|
||||
$this->logger->proclog("Found " . $updateCount . " new commits in Branch: [" . $this->name . "|" . $repo->Name . "|" . $branch->Name . "]");
|
||||
|
||||
$repo_changed = true;
|
||||
$anyChanged = true;
|
||||
|
||||
$db->setChangeDateOnBranch($branch);
|
||||
$db->setChangeDateOnRepository($repo);
|
||||
$db->setUpdateDateOnRepository($repo);
|
||||
}
|
||||
|
||||
if ($repo_changed) $db->setChangeDateOnRepository($repo);
|
||||
if ($repo_changed) $anyChanged = true;
|
||||
}
|
||||
|
||||
$db->commitTransaction();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ($anyChanged)
|
||||
|
Loading…
x
Reference in New Issue
Block a user