mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
add: logging.
This commit is contained in:
parent
beec2e780d
commit
eb1d4c68ea
1 changed files with 19 additions and 0 deletions
|
|
@ -154,6 +154,8 @@ class Migrations extends Action
|
|||
|
||||
$this->sourceReport = $migrationSource->report();
|
||||
|
||||
Console::log(json_encode(['stage' => 'processSource', 'source' => $source], JSON_PRETTY_PRINT));
|
||||
|
||||
return $migrationSource;
|
||||
}
|
||||
|
||||
|
|
@ -164,6 +166,8 @@ class Migrations extends Action
|
|||
{
|
||||
$destination = $migration->getAttribute('destination');
|
||||
|
||||
Console::log(json_encode(['stage' => 'processDestination', 'destination' => $destination], JSON_PRETTY_PRINT));
|
||||
|
||||
return match ($destination) {
|
||||
DestinationAppwrite::getName() => new DestinationAppwrite(
|
||||
$this->project->getId(),
|
||||
|
|
@ -214,6 +218,12 @@ class Migrations extends Action
|
|||
->setPayload($clonedMigrationDocument->getArrayCopy(), ['options', 'credentials'])
|
||||
->trigger();
|
||||
|
||||
Console::log(json_encode([
|
||||
'stage' => 'updateMigrationDocument',
|
||||
'migration' => $migration,
|
||||
'clonedMigration' => $clonedMigrationDocument
|
||||
], JSON_PRETTY_PRINT));
|
||||
|
||||
return $this->dbForProject->updateDocument('migrations', $migration->getId(), $migration);
|
||||
}
|
||||
|
||||
|
|
@ -306,6 +316,15 @@ class Migrations extends Action
|
|||
$transfer->run(
|
||||
$migration->getAttribute('resources'),
|
||||
function () use ($migration, $transfer, $projectDocument, $queueForRealtime) {
|
||||
Console::log(json_encode([
|
||||
'stage' => 'transfer#run',
|
||||
'migration' => $migration,
|
||||
'details' => [
|
||||
'resourceData' => $transfer->getCache(),
|
||||
'statusCounters' => $transfer->getStatusCounters()
|
||||
]
|
||||
], JSON_PRETTY_PRINT));
|
||||
|
||||
$migration->setAttribute('resourceData', json_encode($transfer->getCache()));
|
||||
$migration->setAttribute('statusCounters', json_encode($transfer->getStatusCounters()));
|
||||
$this->updateMigrationDocument($migration, $projectDocument, $queueForRealtime);
|
||||
|
|
|
|||
Loading…
Reference in a new issue