Heartbeat: Don't use a variable of the same name as the function it is in.
fixes #25073. Built from https://develop.svn.wordpress.org/trunk@26626 git-svn-id: http://core.svn.wordpress.org/trunk@26516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bd17d08545
commit
84c8a669d9
|
@ -606,47 +606,48 @@
|
||||||
* @return int Current interval in seconds
|
* @return int Current interval in seconds
|
||||||
*/
|
*/
|
||||||
function interval( speed, ticks ) {
|
function interval( speed, ticks ) {
|
||||||
var interval, oldInerval = settings.tempInterval ? settings.tempInterval : settings.mainInterval;
|
var newInterval,
|
||||||
|
oldInterval = settings.tempInterval ? settings.tempInterval : settings.mainInterval;
|
||||||
|
|
||||||
if ( speed ) {
|
if ( speed ) {
|
||||||
switch ( speed ) {
|
switch ( speed ) {
|
||||||
case 'fast':
|
case 'fast':
|
||||||
case 5:
|
case 5:
|
||||||
interval = 5000;
|
newInterval = 5000;
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
interval = 15000;
|
newInterval = 15000;
|
||||||
break;
|
break;
|
||||||
case 30:
|
case 30:
|
||||||
interval = 30000;
|
newInterval = 30000;
|
||||||
break;
|
break;
|
||||||
case 60:
|
case 60:
|
||||||
interval = 60000;
|
newInterval = 60000;
|
||||||
break;
|
break;
|
||||||
case 'long-polling':
|
case 'long-polling':
|
||||||
// Allow long polling, (experimental)
|
// Allow long polling, (experimental)
|
||||||
settings.mainInterval = 0;
|
settings.mainInterval = 0;
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
interval = settings.originalInterval;
|
newInterval = settings.originalInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( 5000 === interval ) {
|
if ( 5000 === newInterval ) {
|
||||||
ticks = parseInt( ticks, 10 ) || 30;
|
ticks = parseInt( ticks, 10 ) || 30;
|
||||||
ticks = ticks < 1 || ticks > 30 ? 30 : ticks;
|
ticks = ticks < 1 || ticks > 30 ? 30 : ticks;
|
||||||
|
|
||||||
settings.countdown = ticks;
|
settings.countdown = ticks;
|
||||||
settings.tempInterval = interval;
|
settings.tempInterval = newInterval;
|
||||||
} else {
|
} else {
|
||||||
settings.countdown = 0;
|
settings.countdown = 0;
|
||||||
settings.tempInterval = 0;
|
settings.tempInterval = 0;
|
||||||
settings.mainInterval = interval;
|
settings.mainInterval = newInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change the next connection time if new interval has been set.
|
// Change the next connection time if new interval has been set.
|
||||||
// Will connect immediately if the time since the last connection
|
// Will connect immediately if the time since the last connection
|
||||||
// is greater than the new interval.
|
// is greater than the new interval.
|
||||||
if ( interval !== oldInerval ) {
|
if ( newInterval !== oldInterval ) {
|
||||||
scheduleNextTick();
|
scheduleNextTick();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue