SyncRule: provide current runId

This commit is contained in:
Thomas Gelf 2016-06-24 08:36:12 +02:00
parent b4e0bb0a93
commit a9b7861473

View File

@ -30,6 +30,8 @@ class SyncRule extends DbObject
private $sync; private $sync;
private $currentSyncRunId;
private $filter; private $filter;
public function listInvolvedSourceIds() public function listInvolvedSourceIds()
@ -119,9 +121,10 @@ class SyncRule extends DbObject
if ($sync->hasModifications()) { if ($sync->hasModifications()) {
Benchmark::measure('Got modifications for sync rule ' . $this->rule_name); Benchmark::measure('Got modifications for sync rule ' . $this->rule_name);
$this->sync_state = 'pending-changes'; $this->sync_state = 'pending-changes';
if ($apply && $sync->apply()) { if ($apply && $runId = $sync->apply()) {
Benchmark::measure('Successfully synced rule ' . $this->rule_name); Benchmark::measure('Successfully synced rule ' . $this->rule_name);
$this->sync_state = 'in-sync'; $this->sync_state = 'in-sync';
$this->currentSyncRunId = $runId;
} }
$hadChanges = true; $hadChanges = true;