Skip to content

Commit f32147d

Browse files
committed
refactor: comment adjustments
1 parent ce3ea34 commit f32147d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

packages/utils/src/lib/wal-sharded.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,31 +133,31 @@ export class ShardedWal<T extends WalRecord = WalRecord> {
133133
#createdShardFiles: string[] = [];
134134

135135
/**
136-
* Initialize the origin PID environment variable if not already set.
136+
* Initialize the given environment variable if not already set.
137137
* This must be done as early as possible before any user code runs.
138-
* Sets envVarName to the current process ID if not already defined.
138+
* Sets envVarName to the current instance ID if not already defined.
139139
*
140140
* @param envVarName - Environment variable name for storing coordinator ID
141-
* @param profilerID - The profiler ID to set as coordinator
141+
* @param instanceID - The instance ID to set as coordinator
142142
*/
143-
static setCoordinatorProcess(envVarName: string, profilerID: string): void {
143+
static setCoordinatorProcess(envVarName: string, instanceID: string): void {
144144
if (!process.env[envVarName]) {
145-
process.env[envVarName] = profilerID;
145+
process.env[envVarName] = instanceID;
146146
}
147147
}
148148

149149
/**
150-
* Determines if this process is the leader WAL process using the origin PID heuristic.
150+
* Determines if this process is the leader WAL process.
151151
*
152-
* The leader is the process that first enabled profiling (the one that set CP_PROFILER_ORIGIN_PID).
153-
* All descendant processes inherit the environment but have different PIDs.
152+
* The leader is the process that first enabled profiling over the given env var.
153+
* All descendant processes inherit the environment.
154154
*
155155
* @param envVarName - Environment variable name for storing coordinator ID
156-
* @param profilerID - The profiler ID to check
156+
* @param instanceID - The instance ID to check
157157
* @returns true if this is the leader WAL process, false otherwise
158158
*/
159-
static isCoordinatorProcess(envVarName: string, profilerID: string): boolean {
160-
return process.env[envVarName] === profilerID;
159+
static isCoordinatorProcess(envVarName: string, instanceID: string): boolean {
160+
return process.env[envVarName] === instanceID;
161161
}
162162

163163
/**

0 commit comments

Comments
 (0)