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

Enable random delay on start to avoid captcha #175

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GAS85
Copy link

@GAS85 GAS85 commented Aug 1, 2023

By parallel execution some containers will be blocked by captcha, this can be avoided by random delay on start.

@vogler vogler changed the title Enable random delay on start to aviod captcha Enable random delay on start to avoid captcha Aug 1, 2023
@vogler
Copy link
Owner

vogler commented Aug 1, 2023

Can you give some details for what this is needed? Multiple containers for multiple epic-games accounts that you want to run in parallel instead of sequentially?
How do you schedule the runs? Why not change the start time there?

@GAS85
Copy link
Author

GAS85 commented Aug 1, 2023

Hey, I do, when I use cron, I can manage start and sequence no problem here.

Problem for me that I do specify all settings it in the docker-compose file, so whenever I stat/restart docker compose all containers will be starter automatically parallel in this case usually some of them are blocked with captcha. I would like to introduce this optional delay to avoid this situation and use my docker-compose -f /var/docker/docker-compose.yaml up -d as usual for all containers.

@vogler
Copy link
Owner

vogler commented Aug 1, 2023

Couldn't you just prefix some of the command entries in your docker-compose.yaml with sleep 30; (sleep 60; etc.)?
Also see https://stackoverflow.com/questions/31746182/docker-compose-wait-for-container-x-before-starting-y

@GAS85
Copy link
Author

GAS85 commented Aug 1, 2023

I can even put sleep $((RANDOM % 300)); ...
I just thought it will be cool to support it out of the box.
Besides you already use CMD to control what to start and I do not want to end up with not working solution in some days, because CMD part was updated. Using Variable here is harmless.

Also see

depends_on solution will not help here to provide same feature.

@GAS85
Copy link
Author

GAS85 commented Aug 25, 2023

Any reason to not merge it?
I solved it temporary by using following cron job, but this is not so flexible and easy to configure as I would like to have:

perl -le 'sleep rand 900' && docker start games-claimer-user1; perl -le 'sleep rand 900' && docker start games-claimer-user2 ; perl -le 'sleep rand 900' && docker start games-claimer-user3 ;  perl -le 'sleep rand 900' && docker start games-claimer-user4

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

Successfully merging this pull request may close these issues.

None yet

2 participants