Skip to content

Commit c0714f0

Browse files
committed
reload once after new_web_domain_ready
1 parent cdb492e commit c0714f0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

nodeapp.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public function __construct() {
2323
$hcpp->nodeapp = $this;
2424
$hcpp->add_action( 'priv_change_web_domain_proxy_tpl', [ $this, 'priv_change_web_domain_proxy_tpl' ] );
2525
$hcpp->add_action( 'pre_delete_web_domain_backend', [ $this, 'pre_delete_web_domain_backend' ] );
26+
$hcpp->add_action( 'pre_restart_service', [ $this, 'pre_restart_service' ], 50 );
2627
$hcpp->add_action( 'priv_suspend_web_domain', [ $this, 'priv_suspend_web_domain' ] );
2728
$hcpp->add_action( 'priv_unsuspend_domain', [ $this, 'priv_unsuspend_domain' ] );
2829
$hcpp->add_action( 'priv_update_sys_queue', [ $this, 'priv_update_sys_queue' ] );
@@ -137,6 +138,17 @@ public function pre_delete_web_domain_backend( $args ) {
137138
$nodeapp_folder = "/home/$user/web/$domain/nodeapp";
138139
$this->shutdown_apps( $nodeapp_folder );
139140
}
141+
d
142+
/**
143+
* Ensure we reload nginx to read our NodeApp configurations
144+
*/
145+
public function pre_restart_service( $args ) {
146+
global $hcpp;
147+
$service = $args[0];
148+
if ( $service == 'nginx' ) {
149+
shell_exec( 'systemctl reload nginx' );
150+
}
151+
}
140152

141153
/**
142154
* On domain suspend, shutdown apps

0 commit comments

Comments
 (0)