Skip to content

Commit d6ca47a

Browse files
committed
test events
1 parent 4799bba commit d6ca47a

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

packages/wrangler/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ export async function main(argv: string[]): Promise<void> {
713713

714714
const durationMs = Date.now() - startTime;
715715

716-
void dispatcher?.sendNewEvent("wrangler command completed", {
716+
await dispatcher?.sendNewEvent("wrangler command completed", {
717717
command,
718718
args: metricsArgs,
719719
durationMs,
@@ -829,7 +829,7 @@ export async function main(argv: string[]): Promise<void> {
829829

830830
const durationMs = Date.now() - startTime;
831831

832-
void dispatcher?.sendNewEvent("wrangler command errored", {
832+
await dispatcher?.sendNewEvent("wrangler command errored", {
833833
command,
834834
args: metricsArgs,
835835
durationMs,

packages/wrangler/src/metrics/metrics-config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ export function updateMetricsPermission(enabled: boolean) {
146146
* Get the path to the metrics config file.
147147
*/
148148
function getMetricsConfigPath(): string {
149+
console.log(
150+
"getMetricsConfigPath",
151+
path.resolve(getGlobalWranglerConfigPath(), "metrics.json")
152+
);
149153
return path.resolve(getGlobalWranglerConfigPath(), "metrics.json");
150154
}
151155

packages/wrangler/src/metrics/metrics-dispatcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function getMetricsDispatcher(options: MetricsConfigOptions) {
102102

103103
// Do not await this fetch call.
104104
// Just fire-and-forget, otherwise we might slow down the rest of Wrangler.
105-
fetch(`${SPARROW_URL}/api/v1/event`, {
105+
await fetch(`${SPARROW_URL}/api/v1/event`, {
106106
method: "POST",
107107
headers: {
108108
Accept: "*/*",

0 commit comments

Comments
 (0)