Skip to content

Commit

Permalink
Allow migrate to be limited by env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
tuutti committed Jan 20, 2021
1 parent 91a38ac commit 0041cc7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/MigrateTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
*/
trait MigrateTrait {

/**
* Gets the limit.
*
* @return int
* The limit.
*/
public function getLimit() : int {
$limit = getenv('MIGRATE_LIMIT') ?: 0;

return (int) $limit;
}

/**
* Checks if we're doing partial migrate.
*
Expand Down

0 comments on commit 0041cc7

Please sign in to comment.