properly deinit cache

This commit is contained in:
Muki Kiboigo
2026-03-30 08:44:10 -07:00
parent 372b911f20
commit 4f3d5c181e
2 changed files with 8 additions and 0 deletions

View File

@@ -289,6 +289,8 @@ pub fn deinit(self: *Runtime) void {
wba.deinit(self.allocator);
}
if (self.cache) |*cache| cache.deinit();
globalDeinit();
}

View File

@@ -28,6 +28,12 @@ kind: union(enum) {
fs: FsCache,
},
pub fn deinit(self: *Cache) void {
return switch (self.kind) {
inline else => |*c| c.deinit(),
};
}
pub fn get(self: *Cache, arena: std.mem.Allocator, req: CacheRequest) ?CachedResponse {
return switch (self.kind) {
inline else => |*c| c.get(arena, req),