mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 01:18:37 +00:00
parent
4cbf3b1e12
commit
2fcbaee0b6
1 changed files with 2 additions and 11 deletions
|
|
@ -16,7 +16,7 @@ abstract class Migration
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected int $limit = 250;
|
protected int $limit = 100;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Document
|
* @var Document
|
||||||
|
|
@ -108,9 +108,7 @@ abstract class Migration
|
||||||
Console::log('Migrating Collection ' . $collection['$id'] . ':');
|
Console::log('Migrating Collection ' . $collection['$id'] . ':');
|
||||||
|
|
||||||
do {
|
do {
|
||||||
$start = microtime(true);
|
|
||||||
$documents = $this->projectDB->find($collection['$id'], limit: $this->limit, cursor: $nextDocument);
|
$documents = $this->projectDB->find($collection['$id'], limit: $this->limit, cursor: $nextDocument);
|
||||||
var_dump("Fetching documents took " . microtime(true) - $start);
|
|
||||||
$count = count($documents);
|
$count = count($documents);
|
||||||
$sum += $count;
|
$sum += $count;
|
||||||
|
|
||||||
|
|
@ -123,17 +121,10 @@ abstract class Migration
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$start = microtime(true);
|
|
||||||
|
|
||||||
$old = $document->getArrayCopy();
|
$old = $document->getArrayCopy();
|
||||||
$new = call_user_func($callback, $document);
|
$new = call_user_func($callback, $document);
|
||||||
var_dump("migration took " . microtime(true) - $start);
|
|
||||||
|
|
||||||
$start = microtime(true);
|
if (!$this->hasDifference($new->getArrayCopy(), $old)) {
|
||||||
$diff = !$this->hasDifference($new->getArrayCopy(), $old);
|
|
||||||
var_dump("Diff took " . microtime(true) - $start);
|
|
||||||
|
|
||||||
if (!$diff) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue