Skip to content

feat: Add an option to use workers for typescript formatting - #1102

Merged
avallete merged 2 commits into
masterfrom
davidcamachocateura/api-1585-add-option-to-use-workers-to-format-types
Aug 11, 2026
Merged

feat: Add an option to use workers for typescript formatting#1102
avallete merged 2 commits into
masterfrom
davidcamachocateura/api-1585-add-option-to-use-workers-to-format-types

Conversation

@dcamachoc

@dcamachoc dcamachoc commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Main thread relief (opt-in through PG_META_FORMAT_IN_WORKER)

What is the current behavior?

Formatting is always executed within the main thread. While generating types for a table with significant tables or relationships, it can block the event loop for several seconds, leaving other requests and health checks unattended.

What is the new behavior?

When the environment variable PG_META_FORMAT_IN_WORKER is set to true, the typescript generator will use a worker to format the generated types, unblocking the main event loop.

It can be configured using PG_META_FORMAT_POOL_SIZE, PG_META_FORMAT_MAX_QUEUE, PG_META_FORMAT_TIMEOUT_MS and PG_META_FORMAT_IDLE_TIMEOUT_MS.

@dcamachoc
dcamachoc requested review from a team, avallete and soedirgo as code owners August 11, 2026 16:11
@dcamachoc
dcamachoc force-pushed the davidcamachocateura/api-1585-add-option-to-use-workers-to-format-types branch from 9d7af95 to 6ad077a Compare August 11, 2026 16:14
@dcamachoc
dcamachoc force-pushed the davidcamachocateura/api-1585-add-option-to-use-workers-to-format-types branch from 6ad077a to 5e64c16 Compare August 11, 2026 16:15
@dcamachoc dcamachoc changed the title feat: Add option to use worker for typescript formatting feat: Add an option to use worker for typescript formatting Aug 11, 2026
@dcamachoc dcamachoc changed the title feat: Add an option to use worker for typescript formatting feat: Add an option to use workers for typescript formatting Aug 11, 2026
@avallete
avallete merged commit fae1f60 into master Aug 11, 2026
12 of 13 checks passed
@avallete
avallete deleted the davidcamachocateura/api-1585-add-option-to-use-workers-to-format-types branch August 11, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants