Skip to content

Commit

Permalink
Fixed joining being too fast
Browse files Browse the repository at this point in the history
Added Artificial delay to multithreading because it was too fast otherwise
  • Loading branch information
V4NSH4J committed Oct 15, 2021
1 parent 19f06d6 commit 0048b92
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ module Joiner

go 1.15

require github.com/fatih/color v1.13.0 // indirect
require (
github.com/fatih/color v1.13.0 // indirect
github.com/zenthangplus/goccm v0.0.0-20211005163543-2f2e522aca15 // indirect
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/zenthangplus/goccm v0.0.0-20211005163543-2f2e522aca15 h1:0UwX38TojH86Dl0n4OwPMNYy8hNs2NhtzwY4RlvANlA=
github.com/zenthangplus/goccm v0.0.0-20211005163543-2f2e522aca15/go.mod h1:DUzu/BC4TkgUfXP8J1P6Md73Djt+0l0CHq001Pt4weA=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
Expand Down
4 changes: 1 addition & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ func getCookie() cookie {
}
defer resp.Body.Close()



Cookie := cookie{}
if resp.Cookies() != nil {
for _, cookie := range resp.Cookies() {
Expand Down Expand Up @@ -169,7 +167,7 @@ func main() {
var wg sync.WaitGroup
wg.Add(len(lines))
for i := 0; i < len(lines); i++ {
time.Sleep(10 * time.Millisecond)
time.Sleep(5 * time.Millisecond)
go func(i int) {
defer wg.Done()
joinGuild(code, lines[i])
Expand Down

0 comments on commit 0048b92

Please sign in to comment.