Added more fine-granular transactions to EGG2
This commit is contained in:
parent
8186165019
commit
81bbdd1aef
4
www/extern/egg/ExtendedGitGraph2.php
vendored
4
www/extern/egg/ExtendedGitGraph2.php
vendored
@ -62,7 +62,6 @@ class ExtendedGitGraph2 implements ILogger
|
||||
try
|
||||
{
|
||||
$this->db->open();
|
||||
$this->db->beginTransaction();
|
||||
|
||||
$this->proclog("Start incremental data update");
|
||||
$this->proclog();
|
||||
@ -76,11 +75,12 @@ class ExtendedGitGraph2 implements ILogger
|
||||
$this->proclog();
|
||||
}
|
||||
|
||||
$this->db->beginTransaction();
|
||||
$this->db->deleteOldSources(array_map(function (IRemoteSource $v){ return $v->getName(); }, $this->sources));
|
||||
$this->db->commitTransaction();
|
||||
|
||||
$this->proclog("Update finished.");
|
||||
|
||||
$this->db->commitTransaction();
|
||||
$this->proclog("Data written.");
|
||||
|
||||
$this->db->close();
|
||||
|
10
www/extern/egg/RemoteSource.php
vendored
10
www/extern/egg/RemoteSource.php
vendored
@ -51,11 +51,15 @@ abstract class StandardGitConnection implements IRemoteSource
|
||||
{
|
||||
$this->preUpdate();
|
||||
|
||||
$db->beginTransaction();
|
||||
$repos = $this->listAndUpdateRepositories($db);
|
||||
$db->commitTransaction();
|
||||
|
||||
$anyChanged = false;
|
||||
|
||||
foreach ($repos as $repo)
|
||||
{
|
||||
$db->beginTransaction();
|
||||
{
|
||||
$branches = $this->listAndUpdateBranches($db, $repo);
|
||||
$db->setUpdateDateOnRepository($repo);
|
||||
@ -87,13 +91,19 @@ abstract class StandardGitConnection implements IRemoteSource
|
||||
if ($repo_changed) $db->setChangeDateOnRepository($repo);
|
||||
if ($repo_changed) $anyChanged = true;
|
||||
}
|
||||
$db->commitTransaction();
|
||||
}
|
||||
|
||||
if ($anyChanged)
|
||||
{
|
||||
$db->beginTransaction();
|
||||
$db->deleteDanglingCommitdata($this->name);
|
||||
$db->commitTransaction();
|
||||
}
|
||||
|
||||
$db->beginTransaction();
|
||||
$this->postUpdate();
|
||||
$db->commitTransaction();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user