diff --git a/.changeset/ninety-teachers-fold.md b/.changeset/ninety-teachers-fold.md new file mode 100644 index 0000000000..7d40ec2579 --- /dev/null +++ b/.changeset/ninety-teachers-fold.md @@ -0,0 +1,5 @@ +--- +"trigger.dev": patch +--- + +Prevent certain log statements from hanging deployed worker processes diff --git a/packages/cli-v3/src/executions/taskRunProcess.ts b/packages/cli-v3/src/executions/taskRunProcess.ts index a3cc070983..22e3c9f6d5 100644 --- a/packages/cli-v3/src/executions/taskRunProcess.ts +++ b/packages/cli-v3/src/executions/taskRunProcess.ts @@ -84,7 +84,7 @@ export class TaskRunProcess { try { await this.#flush(); } catch (err) { - logger.error("Error flushing task run process", { err }); + console.error("Error flushing task run process", { err }); } await this.kill(); @@ -94,7 +94,7 @@ export class TaskRunProcess { try { await this.#flush(); } catch (err) { - logger.error("Error flushing task run process", { err }); + console.error("Error flushing task run process", { err }); } if (kill) { diff --git a/packages/cli-v3/src/utilities/logger.ts b/packages/cli-v3/src/utilities/logger.ts index 640ceaa486..64a4b3fc13 100644 --- a/packages/cli-v3/src/utilities/logger.ts +++ b/packages/cli-v3/src/utilities/logger.ts @@ -58,7 +58,9 @@ export class Logger { }; info = (...args: unknown[]) => this.doLog("info", args); log = (...args: unknown[]) => this.doLog("log", args); + /** @deprecated **ONLY USE THIS IN THE CLI** - It will hang the process when used in deployed code (!) */ warn = (...args: unknown[]) => this.doLog("warn", args); + /** @deprecated **ONLY USE THIS IN THE CLI** - It will hang the process when used in deployed code (!) */ error = (...args: unknown[]) => this.doLog("error", args); table(data: TableRow[], level?: Exclude) { const keys: Keys[] = data.length === 0 ? [] : (Object.keys(data[0]!) as Keys[]);