Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Offline.options #271

Open
ktapdasan opened this issue Feb 21, 2018 · 3 comments
Open

Offline.options #271

ktapdasan opened this issue Feb 21, 2018 · 3 comments

Comments

@ktapdasan
Copy link

I am getting this error.

SyntaxError: missing ) in parenthetical

On
reconnect: {
initialDelay: 3,
delay: (1.5 * last delay, capped at 1 hour)
}

@schroef
Copy link

schroef commented Apr 18, 2018

They seem to have missed to add proper name. last delay is never declared? I tried adding the var initialDelay which was right above that but get an error that is not declared.

@mfkp
Copy link

mfkp commented Apr 18, 2018

I think that's supposed to be a comment or something. Should probably look like this:

delay: 3 // if null, default is (1.5 * last delay, capped at 1 hour), otherwise specify integer seconds

I just browsed through the source and it looks like it works like this:

If you don't set these options, it will default to a initialDelay of 3, and each time it tries to reconnect, it will multiply the delay by 1.5 (exponential decay).

If you do set the initialDelay and delay options, then it will be a static number of seconds each delay (example, if delay is set to 3, then it will re-check every 3 seconds until reconnected).

@schroef
Copy link

schroef commented Apr 19, 2018

Ahh oke, ill try that. On the other hand, im wondering if this even does anything. Because when you get connecting while its still counting down, it will go online immediately. Thus that makes that count and delay and useless.

EDIT
well i tried couple methods using it with initialDelay above it, without it. Also setting different numbers to delay. Makes no difference, it keeps starting at 10 and countdown.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants