fix(executor): move startTime declaration before try block
The startTime variable was declared inside the try block but referenced in the catch block, causing 'startTime is not defined' errors when exceptions occurred before line 404 (e.g., during req.json() parsing). Moving the declaration before the try ensures it's in scope for the catch block's executionTimeMs calculation.
This commit is contained in:
parent
1ae6923d1a
commit
c8e590419e
1 changed files with 1 additions and 1 deletions
|
|
@ -378,6 +378,7 @@ async function loadAndDescribe(req: Request): Promise<Response> {
|
|||
* Execute a tool with parameters
|
||||
*/
|
||||
async function executeTool(req: Request): Promise<Response> {
|
||||
const startTime = Date.now();
|
||||
try {
|
||||
const body = await req.json();
|
||||
const { packageName, exportName, version, importUrl, params, env } = body;
|
||||
|
|
@ -401,7 +402,6 @@ async function executeTool(req: Request): Promise<Response> {
|
|||
}
|
||||
|
||||
const cacheKey = `${packageName}::${exportName}`;
|
||||
const startTime = Date.now();
|
||||
|
||||
// biome-ignore lint/suspicious/noImplicitAnyLet: Tool type is determined dynamically after import
|
||||
let toolModule;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue