RobertFischer / JQuery-PeriodicalUpdater

A port of Prototype's PeriodicalUpdater to JQuery
282 stars 50 forks source link

Periodical updater only retries one time no matter how I set it up #10

Closed weyus closed 13 years ago

weyus commented 13 years ago

Here is my client code for the PeriodicalUpdater:

var checker = $.PeriodicalUpdater('/admin/koached_messaging_accounts/' + messaging_account_id + '/check', {method: 'get', data: '', minTimeout: 2000, maxTimeout: 2000, multiplier: 1, type: 'text', maxCalls: 0, autoStop: 20 }, function(data) { if (data == 'Verified') { checker.stop() $('#' + network + '_status').text('Verified') $('#' + network + '_status').attr('class', 'verified') $('#' + network + '_button').attr('url', url.replace('verify', 'remove')) $('#' + network + '_button').attr('value', 'Disconnect') } })

I can only get it to do the call twice. The callback is not being called (correctly, since the response data is not different on the 2nd call).

The first call prints out:

Successful run! (In 'success') resetting timer to 2000.

The second call prints out:

Successful run! (In 'success')

and then no more runs. Seems pretty obvious that the reset call needs to be made. After reading the code, I can't see what's wrong, so I'll start doing some harder debugging.

weyus commented 13 years ago

It appears that a multiplier of 1 is effectively ignored. Will fix and issue a pull request.

weyus commented 13 years ago

A pull request has been issued to address this.