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

Locks for concurrent builds in CI/CD (GitHub Actions) #18

Open
JosXa opened this issue Oct 24, 2020 · 3 comments
Open

Locks for concurrent builds in CI/CD (GitHub Actions) #18

JosXa opened this issue Oct 24, 2020 · 3 comments

Comments

@JosXa
Copy link
Owner

JosXa commented Oct 24, 2020

Generally, mtproto sessions hate being run on the same credentials within multiple connections at the same time. This is especially bad when using string sessions. For CI/CD, there needs to be a solution however to run them in parallel, for example when building in a matrix of multiple Python versions (3.7 + 3.8 in the case of tgintegration) or when multiple pull requests get built at the same time. The only reasonable option for passing Telegram sessions to continuous integration are string sessions, at least to my knowledge.

@JosXa JosXa added help wanted Extra attention is needed and removed help wanted Extra attention is needed labels Oct 24, 2020
@JosXa
Copy link
Owner Author

JosXa commented Oct 25, 2020

Idea from @Hackintosh5WasTaken:

Each worker goes:

  • init worker
  • log in as bot
  • check whether account is locked
  • if account is locked, send a message to request the active one creates a new session
  • if account is unlocked, lock it and THEN log in with a session
  • if we get a request to make a new session, first look in the session pool, and if all but one are used, make a new session (through https://core.telegram.org/method/auth.exportLoginToken)

@JosXa
Copy link
Owner Author

JosXa commented Jan 3, 2021

This could be nice: https://github.com/glasslion/redlock

@JosXa
Copy link
Owner Author

JosXa commented Jan 14, 2021

Should be easily solvable via #27

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