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

Blocks when using bg.connect #1385

Open
AlienegraGeek opened this issue May 24, 2024 · 0 comments
Open

Blocks when using bg.connect #1385

AlienegraGeek opened this issue May 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@AlienegraGeek
Copy link

What version of gotd are you using?

v 0.102.0

Can this issue be reproduced with the latest version?

Yes

What did you do?

I'm starting multiple clients that share hashes and ids. When I start to the new client, according to this example, use bg.Connect method, I found that blocking happens, I go to connect debug and find that initDone cannot be executed.But when I rebooted, I found that the existing clients started bg.Connect normally and did not block, as if this only happened when I had started and wanted to add an account client. And occasionally it gets to initDone when I debug. I mean is it asynchronous processing?

My code snippet is like this, every time I start an client, I will batch execute this code, and it will normally reach the bg Connect done log, but when I batch start successfully, I want to add another instance, and then execute this code, I will block at resolver done.

client := telegram.NewClient(apiID, apiHash, options)
fmt.Println("[Start] CManager done")
resolver := storage.NewResolverCache(peer.Plain(api), peerDB)
_ = resolver
fmt.Println("[Start] resolver done")
_, err = bg.Connect(client, bg.WithContext(ctx))
if err != nil {
    fmt.Println("Connect err", err)
    return err
}
fmt.Println("[Start] bg Connect done")

What did you expect to see?

I want to be able to add new instances after I've started an existing one without blocking

What Go version and environment are you using?

go v1.21

@AlienegraGeek AlienegraGeek added the bug Something isn't working label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant