File tree Expand file tree Collapse file tree 2 files changed +2
-15
lines changed Expand file tree Collapse file tree 2 files changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ import { RequestMetrics } from "./metrics.ts";
23
23
import { Router } from "./router.ts" ;
24
24
import type { Functions } from "./stage_2.ts" ;
25
25
import { ErrorType , PassthroughError , UserError } from "./util/errors.ts" ;
26
- import { patchCaches } from "./util/patch_globals.ts" ;
27
26
import "./globals/types.ts" ;
28
27
29
28
interface HandleRequestOptions {
@@ -150,12 +149,6 @@ export const handleRequest = async (
150
149
const cacheAPIToken = getCacheAPIToken ( edgeReq ) ;
151
150
const cacheAPIURL = getCacheAPIURL ( edgeReq ) ;
152
151
153
- // TODO: Once the Cache API has been fully rolled out, remove this call and
154
- // let `patchGlobals` handle this.
155
- if ( cacheAPIToken && cacheAPIURL ) {
156
- patchCaches ( ) ;
157
- }
158
-
159
152
let functionNames = functionNamesHeader . split ( "," ) ;
160
153
161
154
// We don't want to run the same function multiple times in the same chain,
Original file line number Diff line number Diff line change @@ -68,17 +68,11 @@ export const patchGlobals = () => {
68
68
69
69
globalThis . fetch = patchFetchToForwardHeaders ( globalThis . fetch ) ;
70
70
globalThis . fetch = patchFetchToTrackSubrequests ( globalThis . fetch ) ;
71
- } ;
72
71
73
- let hasPatchedCaches = false ;
72
+ patchCaches ( ) ;
73
+ } ;
74
74
75
75
export const patchCaches = ( ) => {
76
- if ( hasPatchedCaches ) {
77
- return ;
78
- }
79
-
80
- hasPatchedCaches = true ;
81
-
82
76
if ( globalThis . caches ) {
83
77
// @ts -expect-error This is the only way to set `globalThis.caches`, even
84
78
// though it's against the type definition.
You can’t perform that action at this time.
0 commit comments