Created
October 30, 2021 11:04
-
-
Save arfaram/f3e1bb97a6b55c1e186f710a56a45642 to your computer and use it in GitHub Desktop.
solve long running Ibexa migration scripts and time execution fraction precision
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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