Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Shard): add env, execArgv, and argv for worker-based shards #10429

Merged
merged 7 commits into from
Aug 20, 2024

Conversation

catplvsplus
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:
Adds env, execArgv, argv to worker thread creation options. This allows the ShardingManagerOptions#execArgv, ShardingManagerOptions#shardArgs and Shard#env to be used not only by the child-process based shards.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

Copy link

vercel bot commented Aug 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Aug 20, 2024 11:26am
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Aug 20, 2024 11:26am

@catplvsplus catplvsplus changed the title fix: add env, execArgv, and argv for worker-based shards fix(Shard): add env, execArgv, and argv for worker-based shards Aug 4, 2024
almeidx
almeidx previously requested changes Aug 4, 2024
Copy link
Member

@almeidx almeidx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These doc comments need updating

/**
* Arguments for the shard's process (only when {@link ShardingManager#mode} is `process`)
* @type {string[]}
*/
this.args = manager.shardArgs ?? [];
/**
* Arguments for the shard's process executable (only when {@link ShardingManager#mode} is `process`)
* @type {string[]}
*/
this.execArgv = manager.execArgv;

@kodiakhq kodiakhq bot merged commit b0f8df0 into discordjs:main Aug 20, 2024
6 checks passed
nyapat pushed a commit to nyapat/discord.js that referenced this pull request Sep 9, 2024
…ordjs#10429)

* fix(Shard): add env, execArgv, and argv to worker-based threads

* chore: remove process only docs assertion from certain shard options

* chore: update comments for Shard.js

* refactor: Use SHARE_ENV for worker shard's env

* chore: import order

---------

Co-authored-by: Cat++ <69035887+NotGhex@users.noreply.github.com>
nyapat pushed a commit to nyapat/discord.js that referenced this pull request Oct 4, 2024
…ordjs#10429)

* fix(Shard): add env, execArgv, and argv to worker-based threads

* chore: remove process only docs assertion from certain shard options

* chore: update comments for Shard.js

* refactor: Use SHARE_ENV for worker shard's env

* chore: import order

---------

Co-authored-by: Cat++ <69035887+NotGhex@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants