Skip to content

Commit 51e2f3d

Browse files
author
cclare
committed
Add apply functions to HAProxy frontend
1 parent 1b80ff6 commit 51e2f3d

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/HAProxyFrontend.inc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,18 @@ class HAProxyFrontend extends Model {
180180

181181
parent::__construct($id, $parent_id, $data, ...$options);
182182
}
183+
184+
/**
185+
* Ensures haproxy is marked as dirty before applying.
186+
*/
187+
public function pre_apply(): void {
188+
touch('/var/run/haproxy.conf.dirty');
189+
}
190+
191+
/**
192+
* Applies changes to the HAProxy configuration.
193+
*/
194+
public function apply(): void {
195+
(new HAProxyApplyDispatcher(async: $this->async))->spawn_process();
196+
}
183197
}

0 commit comments

Comments
 (0)