Changes
1 changed files (+16/-13)
-
-
@@ -375,11 +375,6 @@ ) @This() {return .{ .hash = ImageDownload.getHash(image_key, opts) }; } pub fn getDownloaded(self: *@This()) error{Timeout}!*image.GetResult { try self.ready.timedWait(5_000 * std.time.ns_per_ms); return self.downloaded; } pub fn write(self: *@This(), data: *image.GetResult) void { self.downloaded = data.retain(); self.ready.set();
-
@@ -1168,12 +1163,8 @@ var download_iter = self.internal.image_downloads.valueIterator();while (download_iter.next()) |download| { if (download.*.hash == req_hash) { std.log.debug("Using existing request for image_key={s}", .{image_key}); const downloaded = download.*.getDownloaded() catch { std.log.err("get_image timeout", .{}); return image.GetResult.makeRetainedError(.timeout) catch null; }; return downloaded.retain(); download.*.ready.wait(); return download.*.downloaded.retain(); } } }
-
@@ -1238,12 +1229,24 @@ };std.log.debug("Sent get_image request (ID={d})", .{req_id}); const downloaded = download.getDownloaded() catch { download.ready.timedWait(5_000 * std.time.ns_per_ms) catch { std.log.err("get_image timeout", .{}); // Reusing listeners wait without timeout. So we have to manually // set an error response for them. download.write(image.GetResult.makeError(.timeout) catch { std.log.err( "Failed to set timeout error to reusing listeners," ++ " the listeners goes stale and leaks memory: out of memory", .{}, ); return null; }); return image.GetResult.makeRetainedError(.timeout) catch null; }; return downloaded.retain(); return download.downloaded.retain(); } pub fn export_capi() void {
-