Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry logic is executed twice #38

Open
maximilianvonamerongen opened this issue Oct 25, 2022 · 0 comments
Open

Retry logic is executed twice #38

maximilianvonamerongen opened this issue Oct 25, 2022 · 0 comments

Comments

@maximilianvonamerongen
Copy link

When I restart the instance of the plugin, the system executes the request twice in a row without waiting.

apple-find-me.0 | 2022-10-25 09:35:16.784 | error | Error on HTTP-Request. Please check your credentials. StatusCode: 401 Retry in 5 minutes. (2/3)
apple-find-me.0 | 2022-10-25 09:35:16.613 | error | Error on HTTP-Request. Please check your credentials. StatusCode: 401 Retry in 5 minutes. (1/3)

If I am right the issue is related to recursive access on the Refresh function. But this has to be tested. :)

async function main() {
    //Clear ErrorCounter
    ErrorCounter = 0;
    Refresh(true, false);
}
if(init == true){
  if(adapter.config.refresh != "none"){
    adapter.log.debug("Initial Data Collector");
    RefreshTimeout = setTimeout(function() { Refresh(false, false); }, adapter.config.refresh * 60000);
  }
}else{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant