На самом деле использовался простой запрос ping, который возвращает фактическое состояние процесса:
Код: Выделить всё
function checkState() {
fetch('/cgi/ch_ref.php')
.then(response => response.text())
.then(data => {
// TBD: handle response data
})
.catch(error => {
console.error('Ping error:', error);
});
}
const timerInterval = setInterval(checkState, 30000);
Подробнее здесь: https://stackoverflow.com/questions/799 ... background
Мобильная версия