Skip to content

Commit

Permalink
add logic for infinite displays
Browse files Browse the repository at this point in the history
  • Loading branch information
kristinaElizDev committed Sep 25, 2024
1 parent 336333c commit c1464ed
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pkg/throttle/throttler.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,11 +565,20 @@ func (throttler *Throttler) IsAppThrottled(appName, storeName string) bool {
return false
}

func (throttler *Throttler) ThrottledAppsMap() (result map[string](*base.AppThrottle)) {
result = make(map[string](*base.AppThrottle))
func (throttler *Throttler) ThrottledAppsMap() (result map[string](*base.DisplayAppThrottle)) {

Check failure on line 568 in pkg/throttle/throttler.go

View workflow job for this annotation

GitHub Actions / build

undefined: base.DisplayAppThrottle
result = make(map[string](*base.DisplayAppThrottle))

Check failure on line 569 in pkg/throttle/throttler.go

View workflow job for this annotation

GitHub Actions / build

undefined: base.DisplayAppThrottle

for appName, item := range throttler.throttledApps.Items() {
appThrottle := item.Object.(*base.AppThrottle)
appThrottle := item.Object.(*base.DisplayAppThrottle)

Check failure on line 572 in pkg/throttle/throttler.go

View workflow job for this annotation

GitHub Actions / build

undefined: base.DisplayAppThrottle
expire, expireErr := time.Parse(appThrottle.ExpireAt, "2024-Jan-01")

if expireErr != nil {
panic(expireErr)
}

if expire.IsZero() {
appThrottle.ExpireAt = "INFINITE"
}
result[appName] = appThrottle
}
return result
Expand Down

0 comments on commit c1464ed

Please sign in to comment.