Skip to content

Commit

Permalink
rate limit sticks update [ltm]
Browse files Browse the repository at this point in the history
  • Loading branch information
stronnag committed Aug 22, 2024
1 parent e4f2d8f commit 89b5311
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pkg/ltmgen/ltmgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,12 @@ func LTMGen(ch chan interface{}, meta types.FlightMeta) {

g1diff := time.Duration(100) * time.Millisecond
g2diff := time.Duration(200) * time.Millisecond
g4diff := time.Duration(500) * time.Millisecond
g3diff := time.Duration(2) * time.Second
var g1t time.Time
var g2t time.Time
var g3t time.Time
var g4t time.Time

done := false
for !done {
Expand Down Expand Up @@ -375,11 +377,6 @@ func LTMGen(ch chan interface{}, meta types.FlightMeta) {
l = newLTM('a') // private current
l.paframe(b)
s.Write(l.msg)
if b.Ail > 0 {
l := newLTM('r')
l.prframe(b)
s.Write(l.msg)
}
g2t = b.Utc.Add(g2diff)
}

Expand All @@ -394,6 +391,13 @@ func LTMGen(ch chan interface{}, meta types.FlightMeta) {
g3t = b.Utc.Add(g3diff)
}

if b.Utc.After(g4t) { // sticks
l := newLTM('r')
l.prframe(b)
s.Write(l.msg)
g4t = b.Utc.Add(g4diff)
}

if !lt.IsZero() {
if options.Config.Fast {
time.Sleep(10 * time.Millisecond)
Expand Down

0 comments on commit 89b5311

Please sign in to comment.