Skip to content

Commit

Permalink
attempts to reduce use of data sources for ASN information
Browse files Browse the repository at this point in the history
  • Loading branch information
caffix committed Jun 20, 2023
1 parent 111af71 commit f4ecceb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions datasrcs/scripting/script.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,11 @@ func (s *Script) dispatch(in interface{}) {
if s.cbs.Asn.Type() != lua.LTNil && req != nil && (req.Address != "" || req.ASN != 0) {
callback := s.cbs.Asn
s.cbsLock.Unlock()
s.CheckRateLimit()
s.asnRequest(s.ctx, callback, req)
// check that the cache entry has not already been made by a previous request
if s.sys.Cache().AddrSearch(req.Address) == nil {
s.CheckRateLimit()
s.asnRequest(s.ctx, callback, req)
}
}
case *requests.WhoisRequest:
if s.cbs.Horizontal.Type() != lua.LTNil {
Expand Down

0 comments on commit f4ecceb

Please sign in to comment.