spot-client/src/spot-tv/calendars/calendarService.js
/**
     * Fetches calendar events and sets an interval to fetch again.
     *
     * @param {Object} options - Options required for fetch the calendar events.
     * See {@code getCalendar} for details.
     * @private
     * @returns {void}
     */
Fetches calendar events and sets an interval to fetch again.
@param {Object} options - Options required for fetch the calendar events.
See  getCalendar for details.
@private
@returns {void}
Fetches calendar events and sets an interval to fetch again . @param { Object } options - Options required for fetch the calendar events . See getCalendar for details . @private @returns { void }
_pollForEvents(options) {
        this.getCalendar(options)
            .then(formattedEvents => {
                if (!this._pollingOptionsAreEqual(options)) {
                    return;
                }
                const events = this._updateMeetingUrlOnEvents(formattedEvents);
                if (hasUpdatedEvents(this._calendarEvents, events)) {
                    this._calendarEvents = events;
                    this.emit(
                        SERVICE_UPDATES.EVENTS_UPDATED,
                        { events: this._calendarEvents }
                    );
                }
                this._enqueueNextCalendarPoll(options, 1000 * 60);
            }, error => {
                if (!this._pollingOptionsAreEqual(options)) {
                    return;
                }
                this._calendarEvents = undefined;
                logger.error('Calendar _pollForEvents error: ', { error });
                this.emit(SERVICE_UPDATES.EVENTS_ERROR, { error });
                this._enqueueNextCalendarPoll(options, 1000 * 60 * 5);
            });
    }
_pollForEvents ( options ) { this . getCalendar ( options ) . then ( formattedEvents => { if ( ! this . _pollingOptionsAreEqual ( options ) ) { return ; } const events = this . _updateMeetingUrlOnEvents ( formattedEvents ) ; if ( hasUpdatedEvents ( this . _calendarEvents , events ) ) { this . _calendarEvents = events ; this . emit ( SERVICE_UPDATES . EVENTS_UPDATED , { events : this . _calendarEvents } ) ; } this . _enqueueNextCalendarPoll ( options , 1000 * 60 ) ; } , error => { if ( ! this . _pollingOptionsAreEqual ( options ) ) { return ; } this . _calendarEvents = undefined ; logger . error ( 'Calendar _pollForEvents error: ' , { error } ) ; this . emit ( SERVICE_UPDATES . EVENTS_ERROR , { error } ) ; this . _enqueueNextCalendarPoll ( options , 1000 * 60 * 5 ) ; } ) ; }
Fetches calendar events and sets an interval to fetch again.
Fetches calendar events and sets an interval to fetch again .
// Try again in 1 minute // Try again in 5 minutes