You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import (
"context"
"github.com/gotd/td/telegram"
)
func main() {
// https://core.telegram.org/api/obtaining_api_id
client := telegram.NewClient(appID, appHash, telegram.Options{})
if err := client.Run(context.Background(), func(ctx context.Context) error {
// It is only valid to use client while this function is not returned
// and ctx is not cancelled.
api := client.API()
// Now you can invoke MTProto RPC requests by calling the API.
// ...
// Return to close client connection and free up resources.
return nil
}); err != nil {
panic(err)
}
// Client is closed.
}
Assigned values to variables appID(Int), appHash(String) in the file hello.go
go mod init hello.go
go mod tidy
Ran the code hello.go using go run hello.go and I can't see anything on the screen. It just hangs
When I ran the code in tmux and tried checking from outside of tmux to know if the hang is because of too much usage of CPU/memory using the command top. It's shown that the command "compile" is taking too much CPU power and memory
If I keep running it like this for 5-10 mins, I can't be able to access my instance again. Tried the same procedure in multiple instances but the issue was not resolved
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
What happened?
I am trying to run the example code but have had no luck. It always keeps hanging the AWS instance
Version and System configurations
Go Version: go version go1.19 linux/amd64
System Configurations : AWS Instance 2 GB RAM, 1 vCPU, 60 GB SSD
Operating System: Ubuntu 20.04
Steps to reproduce
Installing the 1.19 version of go through go.dev. followed the installation procedure till setting the paths in .profile
Saved the code from the Usage section https://github.com/gotd/td#usage by naming it as hello.go
Assigned values to variables appID(Int), appHash(String) in the file hello.go
go mod init hello.go
go mod tidy
Ran the code hello.go using
go run hello.go
and I can't see anything on the screen. It just hangsWhen I ran the code in tmux and tried checking from outside of tmux to know if the hang is because of too much usage of CPU/memory using the command top. It's shown that the command "compile" is taking too much CPU power and memory
If I keep running it like this for 5-10 mins, I can't be able to access my instance again. Tried the same procedure in multiple instances but the issue was not resolved
Beta Was this translation helpful? Give feedback.
All reactions