bump github.com/tribalwarshelp/map-generator

This commit is contained in:
Dawid Wysokiński 2020-07-31 21:31:33 +02:00
parent e97fb53bcf
commit ac5436adc2
3 changed files with 11 additions and 5 deletions

2
go.mod
View File

@ -15,7 +15,7 @@ require (
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/pkg/errors v0.9.1
github.com/segmentio/encoding v0.1.14 // indirect
github.com/tribalwarshelp/map-generator v0.0.0-20200623143352-cc037d744be2
github.com/tribalwarshelp/map-generator v0.0.0-20200731193013-79fc85bed99a
github.com/tribalwarshelp/shared v0.0.0-20200728103702-87e7e5f1b8fd
github.com/vektah/gqlparser/v2 v2.0.1
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208

2
go.sum
View File

@ -189,6 +189,8 @@ github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYm
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs=
github.com/tribalwarshelp/map-generator v0.0.0-20200623143352-cc037d744be2 h1:jkieqbdCpAzfRzIBklIkt8+SEG/zdRrJv4LO93oIKMc=
github.com/tribalwarshelp/map-generator v0.0.0-20200623143352-cc037d744be2/go.mod h1:h3INS/arc4MelQjePKvXdrqWjHVVm2s4PKSrsMmkZx8=
github.com/tribalwarshelp/map-generator v0.0.0-20200731193013-79fc85bed99a h1:C5vSBnJPKI+BpUwxp09APIchq5ftUjv1ofuX2xW5hxI=
github.com/tribalwarshelp/map-generator v0.0.0-20200731193013-79fc85bed99a/go.mod h1:hVGbToOex7CV5+DAV6QfVMx1XDgp30DOoyOapbr+Vj4=
github.com/tribalwarshelp/shared v0.0.0-20200622084436-3a768c8bf574 h1:y2EoH6zRK9Uc0AeswnJRYUUIQYcSLZB5VDFuxPCKxNM=
github.com/tribalwarshelp/shared v0.0.0-20200622084436-3a768c8bf574/go.mod h1:tf+2yTHasV6jAF3V2deZ9slNoCyBzC0fMdTjI7clf6Y=
github.com/tribalwarshelp/shared v0.0.0-20200728103702-87e7e5f1b8fd h1:AHGZw26jj2uPgFRPLRouFjJJV97Y/p9zLgSW79ZdcVk=

View File

@ -118,12 +118,14 @@ func (ucase *usecase) GetMarkers(ctx context.Context, cfg servermap.GetMarkersCo
}
for color, tribeIDs := range tribes {
c := color
ids := tribeIDs
g.Go(func() error {
villages, _, err := ucase.villageRepo.Fetch(ctx, village.FetchConfig{
Server: cfg.Server,
Filter: &models.VillageFilter{
PlayerFilter: &models.PlayerFilter{
TribeID: tribeIDs,
TribeID: ids,
},
},
Count: false,
@ -134,7 +136,7 @@ func (ucase *usecase) GetMarkers(ctx context.Context, cfg servermap.GetMarkersCo
mutex.Lock()
markers = append(markers, &generator.Marker{
Villages: villages,
Color: color,
Color: c,
})
mutex.Unlock()
return nil
@ -142,11 +144,13 @@ func (ucase *usecase) GetMarkers(ctx context.Context, cfg servermap.GetMarkersCo
}
for color, playerIDs := range players {
c := color
ids := playerIDs
g.Go(func() error {
villages, _, err := ucase.villageRepo.Fetch(ctx, village.FetchConfig{
Server: cfg.Server,
Filter: &models.VillageFilter{
PlayerID: playerIDs,
PlayerID: ids,
},
Count: false,
})
@ -156,7 +160,7 @@ func (ucase *usecase) GetMarkers(ctx context.Context, cfg servermap.GetMarkersCo
mutex.Lock()
markers = append(markers, &generator.Marker{
Villages: villages,
Color: color,
Color: c,
})
mutex.Unlock()
return nil