Introducing $wgStructuredChangeFiltersLiveUpdatePollingRate
to configure the polling rate for live update.
Allows disabling polling completely by setting it to 0.
Change-Id: I13d3a4bb642c55a16e442f8f8d650c637f13f72c
*/
$wgStructuredChangeFiltersOnWatchlist = false;
*/
$wgStructuredChangeFiltersOnWatchlist = false;
+/**
+ * Polling rate, in seconds, used by the 'live update' and 'view newest' features
+ * of the RCFilters app on SpecialRecentChanges and Special:Watchlist.
+ * 0 to disable completely.
+ */
+$wgStructuredChangeFiltersLiveUpdatePollingRate = 3;
+
/**
* Use new page patrolling to check new pages on Special:Newpages
*/
/**
* Use new page patrolling to check new pages on Special:Newpages
*/
+ $out->addJsConfigVars(
+ 'StructuredChangeFiltersLiveUpdatePollingRate',
+ $this->getConfig()->get( 'StructuredChangeFiltersLiveUpdatePollingRate' )
+ );
+
if ( static::$savedQueriesPreferenceName ) {
$savedQueries = FormatJson::decode(
$this->getUser()->getOption( static::$savedQueriesPreferenceName )
if ( static::$savedQueriesPreferenceName ) {
$savedQueries = FormatJson::decode(
$this->getUser()->getOption( static::$savedQueriesPreferenceName )
this.initializing = false;
this.switchView( 'default' );
this.initializing = false;
this.switchView( 'default' );
- this._scheduleLiveUpdate();
+ this.pollingRate = mw.config.get( 'StructuredChangeFiltersLiveUpdatePollingRate' );
+ if ( this.pollingRate ) {
+ this._scheduleLiveUpdate();
+ }
* @private
*/
mw.rcfilters.Controller.prototype._scheduleLiveUpdate = function () {
* @private
*/
mw.rcfilters.Controller.prototype._scheduleLiveUpdate = function () {
- setTimeout( this._doLiveUpdate.bind( this ), 3000 );
+ setTimeout( this._doLiveUpdate.bind( this ), this.pollingRate * 1000 );
- liveUpdate: mw.config.get( 'wgStructuredChangeFiltersLiveUpdateSupported' ) &&
+ liveUpdate: mw.config.get( 'StructuredChangeFiltersLiveUpdatePollingRate' ) &&
( mw.user.options.get( 'rcenhancedfilters' ) || new mw.Uri().query.liveupdate )
}
};
( mw.user.options.get( 'rcenhancedfilters' ) || new mw.Uri().query.liveupdate )
}
};