CoreFiles by mySites.guru
run-schedule-es5.js44 lines, 1,262 bytes, from Joomla_4.3.3-Stable-Full_Package.zip
Raw History Compare with 4.3.2
md5
1066b15bf8710f03905bfada1d93c4b3
sha1
5efae14ba1535e7413b473f48fbfc4b62ec0d2ed
sha256
b4bbedeb9ede6ba147c2c8a7d9c986fe182bde785e60ab8d23c649c69f3bff0f
(function () {
  'use strict';

  /**
   * @copyright   (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   */

  /**
   * Makes calls to com_ajax to trigger the Scheduler.
   *
   * Used for lazy scheduling of tasks.
   *
   * @package  Joomla.Plugins
   * @subpackage System.ScheduleRunner
   *
   * @since    4.1.0
   */
  if (!window.Joomla) {
    throw new Error('Joomla API was not properly initialised');
  }
  var initScheduler = function initScheduler() {
    var options = Joomla.getOptions('plg_system_schedulerunner');
    var paths = Joomla.getOptions('system.paths');
    var interval = (options && options.interval ? parseInt(options.interval, 10) : 300) * 1000;
    var uri = (paths ? paths.root + "/index.php" : window.location.pathname) + "?option=com_ajax&format=raw&plugin=RunSchedulerLazy&group=system";
    setInterval(function () {
      return fetch(uri, {
        method: 'GET'
      });
    }, interval);

    // Run it at the beginning at least once
    fetch(uri, {
      method: 'GET'
    });
  };
  (function (document) {
    document.addEventListener('DOMContentLoaded', function () {
      initScheduler();
    });
  })(document);

})();

The same content is in 44 releases, Joomla 4.3.2-rc1 to 5.0.0-alpha1. See them all, or every version of this file.