@@ -337,6 +337,9 @@ query stopQuery($stopId: [String]) {
337
337
findStopResponse ,
338
338
findStopError ,
339
339
{
340
+ // find stop should not be throttled since it can make quite frequent
341
+ // updates when fetching stop times for a stop
342
+ noThrottle : true ,
340
343
serviceId : 'stops' ,
341
344
rewritePayload : ( payload ) => {
342
345
// convert pattern array to ID-mapped object
@@ -715,17 +718,19 @@ function createQueryAction (endpoint, responseAction, errorAction, options = {})
715
718
url = `${ api . host } ${ api . port ? ':' + api . port : '' } ${ api . path } /${ endpoint } `
716
719
}
717
720
718
- // don't make a request to a URL that has already seen the same request
719
- // within the last 10 seconds
720
- const throttleKey = options . fetchOptions
721
- ? `${ url } -${ hashObject ( options . fetchOptions ) } `
722
- : url
723
- if ( throttledUrls [ throttleKey ] && throttledUrls [ throttleKey ] > now ( ) - TEN_SECONDS ) {
724
- // URL already had a request within last 10 seconds, warn and exit
725
- console . warn ( `Request throttled for url: ${ url } ` )
726
- return
727
- } else {
728
- throttledUrls [ throttleKey ] = now ( )
721
+ if ( ! options . noThrottle ) {
722
+ // don't make a request to a URL that has already seen the same request
723
+ // within the last 10 seconds
724
+ const throttleKey = options . fetchOptions
725
+ ? `${ url } -${ hashObject ( options . fetchOptions ) } `
726
+ : url
727
+ if ( throttledUrls [ throttleKey ] && throttledUrls [ throttleKey ] > now ( ) - TEN_SECONDS ) {
728
+ // URL already had a request within last 10 seconds, warn and exit
729
+ console . warn ( `Request throttled for url: ${ url } ` )
730
+ return
731
+ } else {
732
+ throttledUrls [ throttleKey ] = now ( )
733
+ }
729
734
}
730
735
let payload
731
736
try {
0 commit comments