Skip to content

Commit 523cebb

Browse files
committed
Add db check on restart
1 parent eacfae8 commit 523cebb

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/PHP.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ public function create( $args, $assoc_args ) {
157157
}
158158
}
159159
$this->site_data['app_admin_email'] = \EE\Utils\get_flag_value( $assoc_args, 'admin_email', strtolower( 'admin@' . $this->site_data['site_url'] ) );
160-
$this->skip_status_check = \EE\Utils\get_flag_value( $assoc_args, 'skip-status-check' );
161-
$this->force = \EE\Utils\get_flag_value( $assoc_args, 'force' );
160+
$this->skip_status_check = \EE\Utils\get_flag_value( $assoc_args, 'skip-status-check' );
161+
$this->force = \EE\Utils\get_flag_value( $assoc_args, 'force' );
162162

163163
\EE\Site\Utils\init_checks();
164164

@@ -455,7 +455,15 @@ private function create_site_db_entry() {
455455
* : Restart db container of site.
456456
*/
457457
public function restart( $args, $assoc_args, $whitelisted_containers = [] ) {
458-
$whitelisted_containers = [ 'nginx', 'php', 'db' ];
458+
459+
$args = auto_site_name( $args, 'php', __FUNCTION__ );
460+
$this->site_data = get_site_info( $args, false );
461+
462+
$whitelisted_containers = [ 'nginx', 'php' ];
463+
464+
if ( ! empty( $this->site_data['db_host'] ) ) {
465+
$whitelisted_containers[] = 'db';
466+
}
459467
parent::restart( $args, $assoc_args, $whitelisted_containers );
460468
}
461469

0 commit comments

Comments
 (0)