move script queue log before request

This commit is contained in:
Muki Kiboigo
2026-04-02 03:26:02 -07:00
parent d18acd5228
commit 3db4b0b61b

View File

@@ -273,7 +273,19 @@ pub fn addFromElement(self: *ScriptManager, comptime from_parser: bool, script_e
// Let the outer errdefer handle releasing the arena if client.request fails // Let the outer errdefer handle releasing the arena if client.request fails
} }
// If we return synchronously (like from cache), we would call evaluate() immediately. if (comptime IS_DEBUG) {
var ls: js.Local.Scope = undefined;
page.js.localScope(&ls);
defer ls.deinit();
log.debug(.http, "script queue", .{
.ctx = ctx,
.url = remote_url.?,
.element = element,
.stack = ls.local.stackTrace() catch "???",
});
}
{ {
const was_evaluating = self.is_evaluating; const was_evaluating = self.is_evaluating;
self.is_evaluating = true; self.is_evaluating = true;
@@ -299,19 +311,6 @@ pub fn addFromElement(self: *ScriptManager, comptime from_parser: bool, script_e
} }
handover = true; handover = true;
if (comptime IS_DEBUG) {
var ls: js.Local.Scope = undefined;
page.js.localScope(&ls);
defer ls.deinit();
log.debug(.http, "script queue", .{
.ctx = ctx,
.url = remote_url.?,
.element = element,
.stack = ls.local.stackTrace() catch "???",
});
}
} }
if (is_blocking == false) { if (is_blocking == false) {