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

[FEAT] Retry on timeout failed #134

Open
1 task done
yusef-ho opened this issue Aug 29, 2023 · 2 comments
Open
1 task done

[FEAT] Retry on timeout failed #134

yusef-ho opened this issue Aug 29, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@yusef-ho
Copy link

Is this a new feature request?

  • I have searched the existing issues

Wanted change

Error Handling

Reason for change

Thanks for the nice tool first.
I've been use it for couple of weeks. It was working well.
But in these two days, there are two conditions occurred,

  1. timeout of anti-captcha
  2. connection aborted

currently, once i received the email of the failed job, i entered the container to execute the command in crontab manually.
Probably add the feature of retry?

Screen_Shot_2023-08-30_at_2_44_44_AM Screen_Shot_2023-08-30_at_2_45_04_AM

Proposed code change

No response

@yusef-ho yusef-ho added the enhancement New feature or request label Aug 29, 2023
@github-actions
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@TommyE123
Copy link
Contributor

Apologies for the delayed reply.
I have encountered similar issues myself, so it would be good to find a solution here!

Currently, the cronjob directly calls the packt-cli command. To better handle potential timeouts, I think we'll need to extract the command into its own script. This script can then wrap the packt-cli call and check if it timed out, possibly by inspecting the last line of the log file.

Additionally, we'll need to determine suitable retry logic in the script - how many retry attempts and over what duration before declaring failure.

Another consideration is whether the packt-cli Python script itself should really handle retries internally. This would keep the cron side simple but would need an external change outside of this container.

I'll try and spend some time reviewing in more depth. Please let me know if you have any other thoughts on the best way to structure this to make the cronjob more robust to timeouts.

Also, if you have any code changes to suggest, I'm open to reviewing pull requests that could improve the cronjob's reliability.

Thanks for logging this issue and I'm confident we can find an optimal approach 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants