Your IP : 10.1.73.149


Current Path : /opt/cpguard/app/resources/goaccess/
Upload File :
Current File : //opt/cpguard/app/resources/goaccess/script.js

// 2 minutes in milliseconds
var interval = 120000; 

function poll() {
    const clean_base = window.location.href.replace(/\/$/, '');
    const url = new URL(clean_base + '/extend');

    fetch(url.toString(), {
        method: 'GET',
        cache: 'no-store'
    })
        .then(response => response.text())
        .then(data => {
            console.log('Request successful');
        })
        .catch(error => {
            console.error('Request failed:', error);
        })
        .finally(() => {
            // Schedules the next poll after the current one finishes
            setTimeout(poll, interval); 
        });
}

// Kick off the first poll
setTimeout(poll, interval);