Skip to content

Instantly share code, notes, and snippets.

@arfaram
Created October 30, 2021 11:04
Show Gist options
  • Save arfaram/f3e1bb97a6b55c1e186f710a56a45642 to your computer and use it in GitHub Desktop.
Save arfaram/f3e1bb97a6b55c1e186f710a56a45642 to your computer and use it in GitHub Desktop.
solve long running Ibexa migration scripts and time execution fraction precision
diff --git a/src/lib/Gateway/MigrationMetadata/DoctrineGateway.php b/src/lib/Gateway/MigrationMetadata/DoctrineGateway.php
index 68c010c..725bd4e 100644
--- a/src/lib/Gateway/MigrationMetadata/DoctrineGateway.php
+++ b/src/lib/Gateway/MigrationMetadata/DoctrineGateway.php
@@ -74,7 +74,7 @@ final class DoctrineGateway
: null;
$executionTime = isset($row[SchemaProvider::MIGRATION_METADATA_EXECUTION_TIME_COLUMN])
- ? (float) ($row[SchemaProvider::MIGRATION_METADATA_EXECUTION_TIME_COLUMN] / 1000)
+ ? (float) ($row[SchemaProvider::MIGRATION_METADATA_EXECUTION_TIME_COLUMN])
: null;
$migration = new ExecutedMigration(
@@ -89,7 +89,7 @@ final class DoctrineGateway
public function complete(ExecutionResult $result): void
{
- $executionTime = $result->getTime() === null ? null : (int)round($result->getTime() * 1000);
+ $executionTime = $result->getTime() === null ? null : (int)round($result->getTime());
$qb = $this->connection->createQueryBuilder();
$qb->insert(SchemaProvider::MIGRATION_METADATA_TABLE);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment