ubiquity-os-marketplace / text-conversation-rewards

1 stars 27 forks source link

feat: exponential backoff on retrieval failure #63

Closed gentlementlegen closed 4 months ago

gentlementlegen commented 4 months ago

Resolves #4

gentlementlegen commented 4 months ago

What's new

When retrieving the comments, if there is any failure, the script will attempt again to fetch the comments. In the meantime, it updates the comment in the Issue saying that it is retrying, until eventually put a final error message if it keeps failing.

The amount of tries and the delay is configurable through variables within the configuration file. Related tests have been added as well.

QA run

https://github.com/Meniole/conversation-rewards/issues/6#issuecomment-2238042624 (Click on the edited button of the bot's comment to see all the messages that were displayed during the run).

gentlementlegen commented 4 months ago

@0x4007 We can do that although in this case it cannot be more than 6 hours before the Action is shut down, don't know if it is that useful. I guess we can still put "10 minutes" or "1 hour".

whilefoo commented 4 months ago

actually there is an official octokit plugin plugin-retry that handles retries for all octokit requests - we are already using this in the kernel

gentlementlegen commented 4 months ago

@whilefoo thanks for the information. I can switch to that package within another pull request.