Post-processing after a response is shipped for a request
(username, path string, req *http.Request, egress int64)
| 80 | |
| 81 | // Post-processing after a response is shipped for a request |
| 82 | func completeRequest(username, path string, req *http.Request, egress int64) { |
| 83 | if limiter == nil || !limiter.isActive() { |
| 84 | // rateLimiter not active |
| 85 | return |
| 86 | } |
| 87 | |
| 88 | // evaluate request completion at endpoints .. |
| 89 | // index creation/update/deletion: /api/index/{indexName} |
| 90 | // search request: /api/index/{indexName}/query |
| 91 | if path != indexPath && path != queryPath { |
| 92 | return |
| 93 | } |
| 94 | |
| 95 | limiter.completeRequest(username, path, req, egress) |
| 96 | } |
| 97 | |
| 98 | // ----------------------------------------------------------------------------- |
| 99 |
no test coverage detected