miniflare 0.0.0-e2e6912bc → 0.0.0-e2f5756c2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8691,8 +8691,9 @@ var Analytics = class {
8691
8691
  // double2
8692
8692
  this.data.metalId ?? -1,
8693
8693
  // double3
8694
- this.data.coloTier ?? -1
8694
+ this.data.coloTier ?? -1,
8695
8695
  // double4
8696
+ this.data.userWorkerAhead === void 0 ? -1 : Number(this.data.userWorkerAhead)
8696
8697
  ],
8697
8698
  blobs: [
8698
8699
  this.data.hostname?.substring(0, 256),
@@ -8723,16 +8724,24 @@ var src_default = {
8723
8724
  env.SENTRY_ACCESS_CLIENT_SECRET
8724
8725
  );
8725
8726
  let url = new URL(request.url);
8726
- sentry && (sentry.setUser({ username: url.hostname }), sentry.setTag("colo", env.COLO_METADATA.coloId), sentry.setTag("metal", env.COLO_METADATA.metalId)), env.COLO_METADATA && env.VERSION_METADATA && analytics.setData({
8727
+ sentry && (sentry.setUser({ username: url.hostname }), sentry.setTag("colo", env.COLO_METADATA.coloId), sentry.setTag("metal", env.COLO_METADATA.metalId)), env.COLO_METADATA && env.VERSION_METADATA && env.CONFIG && analytics.setData({
8727
8728
  coloId: env.COLO_METADATA.coloId,
8728
8729
  metalId: env.COLO_METADATA.metalId,
8729
8730
  coloTier: env.COLO_METADATA.coloTier,
8730
8731
  coloRegion: env.COLO_METADATA.coloRegion,
8731
8732
  hostname: url.hostname,
8732
- version: env.VERSION_METADATA.id
8733
+ version: env.VERSION_METADATA.id,
8734
+ userWorkerAhead: env.CONFIG.invoke_user_worker_ahead_of_assets
8733
8735
  });
8734
8736
  let maybeSecondRequest = request.clone();
8735
- return env.CONFIG.has_user_worker ? await env.ASSET_WORKER.unstable_canFetch(request) ? (analytics.setData({ dispatchtype: "asset" /* ASSETS */ }), await env.ASSET_WORKER.fetch(maybeSecondRequest)) : (analytics.setData({ dispatchtype: "worker" /* WORKER */ }), env.USER_WORKER.fetch(maybeSecondRequest)) : (analytics.setData({ dispatchtype: "asset" /* ASSETS */ }), await env.ASSET_WORKER.fetch(request));
8737
+ if (env.CONFIG.invoke_user_worker_ahead_of_assets) {
8738
+ if (!env.CONFIG.has_user_worker)
8739
+ throw new Error(
8740
+ "Fetch for user worker without having a user worker binding"
8741
+ );
8742
+ return env.USER_WORKER.fetch(maybeSecondRequest);
8743
+ }
8744
+ return env.CONFIG.has_user_worker ? await env.ASSET_WORKER.unstable_canFetch(request) ? (analytics.setData({ dispatchtype: "asset" /* ASSETS */ }), env.ASSET_WORKER.fetch(maybeSecondRequest)) : (analytics.setData({ dispatchtype: "worker" /* WORKER */ }), env.USER_WORKER.fetch(maybeSecondRequest)) : (analytics.setData({ dispatchtype: "asset" /* ASSETS */ }), env.ASSET_WORKER.fetch(request));
8736
8745
  } catch (err) {
8737
8746
  throw err instanceof Error && analytics.setData({ error: err.message }), sentry && sentry.captureException(err), err;
8738
8747
  } finally {