Skip to content

Commit cb3504d

Browse files
committed
api/v2/reload: use flb_config->bin_restarting to signal hot reload on windows.
Signed-off-by: Phillip Whelan <[email protected]>
1 parent 99ce196 commit cb3504d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/http_server/api/v2/reload.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ static void handle_reload_request(mk_request_t *request, struct flb_config *conf
6767
http_status = 400;
6868
}
6969
else {
70-
ret = GenerateConsoleCtrlEvent(1 /* CTRL_BREAK_EVENT_1 */, 0);
71-
if (ret == 0) {
72-
mk_http_status(request, 500);
73-
mk_http_done(request);
74-
return;
75-
}
70+
/* we are using the `bin_restarting` property inside `flb_config` to
71+
* use it as a messaging mechanism instead of GenerateConsoleCtrlEvent
72+
* to overcome the fact that windows services do not have a console and
73+
* therefore cannot react to console events or handle them.
74+
*/
75+
config->bin_restarting = FLB_RELOAD_IN_PROGRESS;
7676

7777
msgpack_pack_str(&mp_pck, 4);
7878
msgpack_pack_str_body(&mp_pck, "done", 4);

0 commit comments

Comments
 (0)