Skip to content
This repository has been archived by the owner on Nov 12, 2023. It is now read-only.

Commit

Permalink
more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio1988 committed Sep 13, 2023
1 parent 9b14678 commit c621067
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion routes/raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ func Raw(c *gin.Context) {
if ws.CheckLimitExceeded() {
log.Warnf("[RAW] [%s] Account would exceed soft limits - DISABLED ACCOUNT: [%s]", res.Uuid, res.Username)
accountManager.MarkDisabled(res.Username)

}
counts := ws.RequestCounts()
if len(counts) > 0 {
log.Infof("[RAW] [%s] [%s] Account limits: %v", res.Uuid, res.Username, counts)
}
}()
}
Expand Down
4 changes: 4 additions & 0 deletions worker/workerState.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,7 @@ func (ws *State) IncrementLimit(method int) {
func (ws *State) CheckLimitExceeded() bool {
return ws.requestCounter.CheckLimitsExceeded()
}

func (ws *State) RequestCounts() map[int]int {
return ws.requestCounter.RequestCounts()
}

0 comments on commit c621067

Please sign in to comment.