File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,17 @@ function isIndexingServiceEnabled (request, env) {
6262 const withIndexingServicesArg = new URL ( request . url ) . searchParams
6363 . getAll ( 'ff' )
6464 . includes ( 'indexing-service' )
65- const probability = env . FF_RAMP_UP_PROBABILITY ? Number ( env . FF_RAMP_UP_PROBABILITY ) : 0
66- const withIndexerEnabled = Math . random ( ) * 100 <= probability
67- return withIndexingServicesArg || withIndexerEnabled
65+ const withoutIndexingServicesArg = new URL ( request . url ) . searchParams
66+ . getAll ( 'ff' )
67+ . includes ( 'no-indexing-service' )
68+ const probability = env . FF_RAMP_UP_PROBABILITY
69+ ? Number ( env . FF_RAMP_UP_PROBABILITY )
70+ : 0
71+ const withIndexerEnabledProbabalistically = Math . random ( ) * 100 <= probability
72+ return (
73+ // We haven't explicitly disabled the indexing service, and
74+ ! withoutIndexingServicesArg &&
75+ // We have explicitly enabled the indexing service, or hit it probabilistically.
76+ ( withIndexingServicesArg || withIndexerEnabledProbabalistically )
77+ )
6878}
You can’t perform that action at this time.
0 commit comments