Просмотр исходного кода

Align naming about scout raids

tags/v2.2.0^2^2
9seconds 1 месяц назад
Родитель
Сommit
d43d6692d7
1 измененных файлов: 11 добавлений и 11 удалений
  1. 11
    11
      mtglib/internal/doppel/ganger.go

+ 11
- 11
mtglib/internal/doppel/ganger.go Просмотреть файл

10
 
10
 
11
 const (
11
 const (
12
 	DoppelGangerMaxDurations     = 4096
12
 	DoppelGangerMaxDurations     = 4096
13
-	DoppelGangerScoutMissionEach = 30 * time.Minute
13
+	DoppelGangerScoutRaidEach = 30 * time.Minute
14
 	DoppelGangerScoutRepeats     = 10
14
 	DoppelGangerScoutRepeats     = 10
15
 )
15
 )
16
 
16
 
26
 	wg        sync.WaitGroup
26
 	wg        sync.WaitGroup
27
 
27
 
28
 	scout               Scout
28
 	scout               Scout
29
-	scoutMissionEach    time.Duration
30
-	scoutMissionRepeats int
29
+	scoutRaidEach    time.Duration
30
+	scoutRaidRepeats int
31
 
31
 
32
 	stats     *Stats
32
 	stats     *Stats
33
 	durations []time.Duration
33
 	durations []time.Duration
68
 }
68
 }
69
 
69
 
70
 func (g *Ganger) run() {
70
 func (g *Ganger) run() {
71
-	scoutTicker := time.NewTicker(g.scoutMissionEach)
71
+	scoutTicker := time.NewTicker(g.scoutRaidEach)
72
 	defer func() {
72
 	defer func() {
73
 		scoutTicker.Stop()
73
 		scoutTicker.Stop()
74
 
74
 
84
 	updatedStatsChan := make(chan *Stats)
84
 	updatedStatsChan := make(chan *Stats)
85
 
85
 
86
 	g.wg.Go(func() {
86
 	g.wg.Go(func() {
87
-		g.runScoutMission(scoutCollectedChan)
87
+		g.runScoutRaid(scoutCollectedChan)
88
 	})
88
 	})
89
 
89
 
90
 	for {
90
 	for {
109
 			currentScoutCollectedChan = scoutCollectedChan
109
 			currentScoutCollectedChan = scoutCollectedChan
110
 		case <-scoutTicker.C:
110
 		case <-scoutTicker.C:
111
 			g.wg.Go(func() {
111
 			g.wg.Go(func() {
112
-				g.runScoutMission(scoutCollectedChan)
112
+				g.runScoutRaid(scoutCollectedChan)
113
 			})
113
 			})
114
 		case req := <-g.connRequests:
114
 		case req := <-g.connRequests:
115
 			select {
115
 			select {
120
 	}
120
 	}
121
 }
121
 }
122
 
122
 
123
-func (g *Ganger) runScoutMission(rvChan chan<- []time.Duration) {
123
+func (g *Ganger) runScoutRaid(rvChan chan<- []time.Duration) {
124
 	durations := []time.Duration{}
124
 	durations := []time.Duration{}
125
 
125
 
126
-	for range g.scoutMissionRepeats {
126
+	for range g.scoutRaidRepeats {
127
 		learned, err := g.scout.Learn(g.ctx)
127
 		learned, err := g.scout.Learn(g.ctx)
128
 		if err != nil {
128
 		if err != nil {
129
 			g.logger.WarningError("cannot learn", err)
129
 			g.logger.WarningError("cannot learn", err)
150
 	ctx, cancel := context.WithCancel(ctx)
150
 	ctx, cancel := context.WithCancel(ctx)
151
 
151
 
152
 	if scoutEach == 0 {
152
 	if scoutEach == 0 {
153
-		scoutEach = DoppelGangerScoutMissionEach
153
+		scoutEach = DoppelGangerScoutRaidEach
154
 	}
154
 	}
155
 
155
 
156
 	if scoutRepeats == 0 {
156
 	if scoutRepeats == 0 {
161
 		ctx:                 ctx,
161
 		ctx:                 ctx,
162
 		ctxCancel:           cancel,
162
 		ctxCancel:           cancel,
163
 		logger:              logger,
163
 		logger:              logger,
164
-		scoutMissionEach:    scoutEach,
165
-		scoutMissionRepeats: scoutRepeats,
164
+		scoutRaidEach:    scoutEach,
165
+		scoutRaidRepeats: scoutRepeats,
166
 		stats: &Stats{
166
 		stats: &Stats{
167
 			k:      StatsDefaultK,
167
 			k:      StatsDefaultK,
168
 			lambda: StatsDefaultLambda,
168
 			lambda: StatsDefaultLambda,

Загрузка…
Отмена
Сохранить