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

Skip optional workers based on port number #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions scripts/generate-dotenv.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ function buildProdEnv(commitHash) {
DEMO_APPS_SHARED_SECRET: secrets.DEMO_APPS_SHARED_SECRET.key,
LOOPS_SO_API_KEY: secrets.LOOPS_SO_API_KEY.api_key,
PYROSCOPE_ENDPOINT: 'http://monitoring.int.cord.com:4040',
IGNORE_ADMIN_SERVER_WORKER: false,
IGNORE_CONSOLE_SERVER_WORKER: false,
};
}

Expand Down
6 changes: 0 additions & 6 deletions server/src/config/Env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,4 @@ export default magicEnv(process.env, {

// loops.so for sending newletters
LOOPS_SO_API_KEY: required,

// Make Admin Server Optional
IGNORE_ADMIN_SERVER_WORKER: optional,

// Make Admin Server Optional
IGNORE_CONSOLE_SERVER_WORKER: optional,
});
10 changes: 8 additions & 2 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ async function main() {
// -------------------------------------------------------------------------
// ADMIN

if (!env.IGNORE_ADMIN_SERVER_WORKER && (isSingleProcessOrMaster || workerType === 'admin')) {
if (
env.ADMIN_SERVER_PORT &&
(isSingleProcessOrMaster || workerType === 'admin')
) {
// Either we are not in cluster mode, or this process is the master or an
// 'admin' worker. (If this is a worker process of a different type, we skip
// this section.)
Expand Down Expand Up @@ -210,7 +213,10 @@ async function main() {
// -------------------------------------------------------------------------
// CONSOLE

if (!env.IGNORE_CONSOLE_SERVER_WORKER && (isSingleProcessOrMaster || workerType === 'console')) {
if (
env.CONSOLE_SERVER_PORT &&
(isSingleProcessOrMaster || workerType === 'console')
) {
// Either we are not in cluster mode, or this process is the master or an
// 'console' worker. (If this is a worker process of a different type, we skip
// this section.)
Expand Down