diff options
Diffstat (limited to 'src/cli')
-rw-r--r-- | src/cli/create_command.zig | 8 | ||||
-rw-r--r-- | src/cli/upgrade_command.zig | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/cli/create_command.zig b/src/cli/create_command.zig index b653aa4a7..7e3ea96eb 100644 --- a/src/cli/create_command.zig +++ b/src/cli/create_command.zig @@ -1847,7 +1847,7 @@ pub const Example = struct { var async_http: *HTTP.AsyncHTTP = ctx.allocator.create(HTTP.AsyncHTTP) catch unreachable; async_http.* = try HTTP.AsyncHTTP.init(ctx.allocator, .GET, api_url, header_entries, headers_buf, mutable, &request_body, 60 * std.time.ns_per_min); async_http.client.progress_node = progress; - const response = try async_http.sendSync(); + const response = try async_http.sendSync(true); switch (response.status_code) { 404 => return error.GitHubRepositoryNotFound, @@ -1913,7 +1913,7 @@ pub const Example = struct { var async_http: *HTTP.AsyncHTTP = ctx.allocator.create(HTTP.AsyncHTTP) catch unreachable; async_http.* = try HTTP.AsyncHTTP.init(ctx.allocator, .GET, url, .{}, "", mutable, &request_body, 60 * std.time.ns_per_min); async_http.client.progress_node = progress; - var response = try async_http.sendSync(); + var response = try async_http.sendSync(true); switch (response.status_code) { 404 => return error.ExampleNotFound, @@ -1992,7 +1992,7 @@ pub const Example = struct { refresher.maybeRefresh(); - response = try async_http.sendSync(); + response = try async_http.sendSync(true); refresher.maybeRefresh(); @@ -2023,7 +2023,7 @@ pub const Example = struct { async_http.client.progress_node = progress_node; } - const response = async_http.sendSync() catch |err| { + const response = async_http.sendSync(true) catch |err| { switch (err) { error.WouldBlock => { Output.prettyErrorln("Request timed out while trying to fetch examples list. Please try again", .{}); diff --git a/src/cli/upgrade_command.zig b/src/cli/upgrade_command.zig index b3445e278..3f6a4840d 100644 --- a/src/cli/upgrade_command.zig +++ b/src/cli/upgrade_command.zig @@ -95,7 +95,9 @@ pub const UpgradeCheckerThread = struct { js_ast.Expr.Data.Store.deinit(); js_ast.Stmt.Data.Store.deinit(); } - const version = (try UpgradeCommand.getLatestVersion(default_allocator, env_loader, undefined, undefined, true)) orelse return; + var arena = std.heap.ArenaAllocator.init(default_allocator); + defer arena.deinit(); + const version = (try UpgradeCommand.getLatestVersion(arena.allocator(), env_loader, undefined, undefined, true)) orelse return; if (!version.isCurrent()) { if (version.name()) |name| { @@ -182,7 +184,7 @@ pub const UpgradeCommand = struct { var async_http: *HTTP.AsyncHTTP = allocator.create(HTTP.AsyncHTTP) catch unreachable; async_http.* = try HTTP.AsyncHTTP.init(allocator, .GET, api_url, header_entries, headers_buf, &metadata_body, &request_body, 60 * std.time.ns_per_min); if (!silent) async_http.client.progress_node = progress; - const response = try async_http.sendSync(); + const response = try async_http.sendSync(true); switch (response.status_code) { 404 => return error.HTTP404, @@ -407,7 +409,7 @@ pub const UpgradeCommand = struct { ); async_http.client.timeout = timeout; async_http.client.progress_node = progress; - const response = try async_http.sendSync(); + const response = try async_http.sendSync(true); switch (response.status_code) { 404 => return error.HTTP404, |