fix apache restart monitor

This commit is contained in:
Dmitry Belyaev 2021-06-17 12:50:43 +03:00
parent daadee9190
commit fd87391383
Signed by: b4tman
GPG Key ID: 41A00BF15EA7E5F3

View File

@ -10,18 +10,17 @@ export default {
state: {
apache_need_restart: false,
restart_flag: false,
flag_sent: false,
},
mutations: {
setApacheNeedRestart(state) {
state.apache_need_restart = true;
},
setApacheRestartFlag(state, flag) {
if (state.restart_flag && !flag) {
state.apache_need_restart = false;
}
state.restart_flag = flag;
},
setApacheRestartFlagSent(state, flag) {
state.flag_sent = flag;
},
},
actions: {
async fetchApacheRestartFlag(ctx) {
@ -30,10 +29,6 @@ export default {
ctx.commit("setApacheRestartFlag", true);
} catch (err) {
ctx.commit("setApacheRestartFlag", false);
if (ctx.getters.isApacheRestartFlagSent) {
ctx.commit("setApacheNeedRestart", false);
ctx.commit("setApacheRestartFlagSent", false);
}
}
},
async updateApacheRestartFlag(ctx) {
@ -46,7 +41,6 @@ export default {
try {
await axios.put(`${api_base}/apache-restart`);
ctx.commit("setApacheRestartFlag", true);
ctx.commit("setApacheRestartFlagSent", true);
} catch (err) {
pass();
}
@ -59,8 +53,5 @@ export default {
isApacheRestartPending(state) {
return state.restart_flag;
},
isApacheRestartFlagSent(state) {
return state.flag_sent;
},
},
};