Skip to content

Commit

Permalink
Merge pull request #1852 from mrrobot47/update/space-check
Browse files Browse the repository at this point in the history
Update space check
  • Loading branch information
mrrobot47 committed Aug 8, 2024
2 parents f5485c1 + c5e4c68 commit fb766e4
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions php/EE/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,21 @@ public function check_requirements( $show_error = true ) {
private function migrate() {

// Check if minimum 5GB disk space is available
$free_space = disk_free_space( EE_ROOT_DIR );
$docker_dir = EE::launch( 'docker info --format \'{{.DockerRootDir}}\'' )->stdout;
$free_space_docker = disk_free_space( $docker_dir );
$required_space = 5 * 1024 * 1024 * 1024;
$free_space = 0;
$free_space_docker = 0;

if ( $free_space < 5 * 1024 * 1024 * 1024 || $free_space_docker < 5 * 1024 * 1024 * 1024 ) {
if ( is_dir( EE_ROOT_DIR ) ) {
$free_space = disk_free_space( EE_ROOT_DIR );
}

$docker_dir = EE::launch( 'docker info --format \'{{.DockerRootDir}}\'' )->stdout;

if ( is_dir( $docker_dir ) ) {
$free_space_docker = disk_free_space( $docker_dir );
}

if ( ( $free_space < $required_space && is_dir( EE_ROOT_DIR ) ) || ( $free_space_docker < $required_space && is_dir( $docker_dir ) ) ) {
EE::error( 'EasyEngine update requires minimum 5GB disk space to run. Please free up some space and try again.' );
}

Expand Down

0 comments on commit fb766e4

Please sign in to comment.