Skip to content

Commit 26b734c

Browse files
committed
refactor: rename method
1 parent a78b157 commit 26b734c

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

packages/utils/src/lib/wal.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,10 @@ export function isCoordinatorProcess(
362362
* This must be done as early as possible before any user code runs.
363363
* Sets envVarName to the current process ID if not already defined.
364364
*/
365-
export function setLeaderWal(envVarName: string, profilerID: string): void {
365+
export function setCoordinatorProcess(
366+
envVarName: string,
367+
profilerID: string,
368+
): void {
366369
if (!process.env[envVarName]) {
367370
// eslint-disable-next-line functional/immutable-data
368371
process.env[envVarName] = profilerID;

packages/utils/src/lib/wal.unit.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
isCoordinatorProcess,
1616
parseWalFormat,
1717
recoverFromContent,
18-
setLeaderWal,
18+
setCoordinatorProcess,
1919
stringCodec,
2020
} from './wal.js';
2121

@@ -714,7 +714,7 @@ describe('isCoordinatorProcess', () => {
714714
});
715715
});
716716

717-
describe('setLeaderWal', () => {
717+
describe('setCoordinatorProcess', () => {
718718
beforeEach(() => {
719719
// Clean up any existing TEST_ORIGIN_PID
720720
// eslint-disable-next-line functional/immutable-data
@@ -725,7 +725,7 @@ describe('setLeaderWal', () => {
725725
expect(process.env['TEST_ORIGIN_PID']).toBeUndefined();
726726

727727
const profilerId = `${Math.round(performance.timeOrigin)}${process.pid}.1.0`;
728-
setLeaderWal('TEST_ORIGIN_PID', profilerId);
728+
setCoordinatorProcess('TEST_ORIGIN_PID', profilerId);
729729

730730
expect(process.env['TEST_ORIGIN_PID']).toBe(profilerId);
731731
});
@@ -735,14 +735,14 @@ describe('setLeaderWal', () => {
735735
const newProfilerId = `${Math.round(performance.timeOrigin)}${process.pid}.2.0`;
736736

737737
vi.stubEnv('TEST_ORIGIN_PID', existingProfilerId);
738-
setLeaderWal('TEST_ORIGIN_PID', newProfilerId);
738+
setCoordinatorProcess('TEST_ORIGIN_PID', newProfilerId);
739739

740740
expect(process.env['TEST_ORIGIN_PID']).toBe(existingProfilerId);
741741
});
742742

743743
it('should set env var to profiler id', () => {
744744
const profilerId = `${Math.round(performance.timeOrigin)}${process.pid}.1.0`;
745-
setLeaderWal('TEST_ORIGIN_PID', profilerId);
745+
setCoordinatorProcess('TEST_ORIGIN_PID', profilerId);
746746

747747
expect(process.env['TEST_ORIGIN_PID']).toBe(profilerId);
748748
});

0 commit comments

Comments
 (0)