js/dataManager/dataManager.js
function init(){

    eventDataPairs = 0;
    currentSession = sessionManager.createSession();
    lastRequestTime = utils.getUnixTimeInSeconds();
    mediaPlaying = false;

    // checks if time since last request has exceeded the maximum request time
    if (timeSinceRequestChecker){

        clearInterval(timeSinceRequestChecker);
        timeSinceRequestChecker = null;

    }

    timeSinceRequestChecker = setInterval(
        () => {
            const currentTime = utils.getUnixTimeInSeconds();
            if (currentTime - lastRequestTime > config.getDataPostTimeInterval()){

                _createDataRequest();

            }
        }, 
        1000);

}
function init(){

    eventDataPairs = 0;
    currentSession = sessionManager.createSession();
    lastRequestTime = utils.getUnixTimeInSeconds();
    mediaPlaying = false;

    // checks if time since last request has exceeded the maximum request time
    if (timeSinceRequestChecker){

        clearInterval(timeSinceRequestChecker);
        timeSinceRequestChecker = null;

    }

    timeSinceRequestChecker = setInterval(
        () => {
            const currentTime = utils.getUnixTimeInSeconds();
            if (currentTime - lastRequestTime > config.getDataPostTimeInterval()){

                _createDataRequest();

            }
        }, 
        1000);

}
function init ( ) { eventDataPairs = 0 ; currentSession = sessionManager . createSession ( ) ; lastRequestTime = utils . getUnixTimeInSeconds ( ) ; mediaPlaying = false ; // checks if time since last request has exceeded the maximum request time if ( timeSinceRequestChecker ) { clearInterval ( timeSinceRequestChecker ) ; timeSinceRequestChecker = null ; } timeSinceRequestChecker = setInterval ( ( ) => { const currentTime = utils . getUnixTimeInSeconds ( ) ; if ( currentTime - lastRequestTime > config . getDataPostTimeInterval ( ) ) { _createDataRequest ( ) ; } } , 1000 ) ; }
Init the collection of data
@memberof DataManager
Init the collection of data