Skip to content

Commit f08f311

Browse files
committed
reduced development() calls
1 parent 9f50c67 commit f08f311

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/host/src/lib/host.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ const PARALLEL_SEQUENCE_STARTUP = 4;
6363

6464
type HostSizes = "xs" | "s" | "m" | "l" | "xl";
6565
const GigaByte = 1024 << 20;
66+
const isDevelopment = development();
6667

6768
/**
6869
* Host provides functionality to manage Instances and Sequences.
@@ -207,7 +208,7 @@ export class Host implements IComponent {
207208

208209
prettyLog.pipe(process.stdout);
209210

210-
if (development()) this.logger.info("config", this.config);
211+
if (isDevelopment) this.logger.info("config", this.config);
211212

212213
this.config.host.id ||= this.getId();
213214
this.logger.updateBaseLog({ id: this.config.host.id });
@@ -712,7 +713,7 @@ export class Host implements IComponent {
712713
sequenceAdapter.logger.pipe(this.logger);
713714

714715
for (const config of configs) {
715-
if (development()) this.logger.trace(`Sequence identified: ${config.id}`);
716+
if (isDevelopment) this.logger.trace(`Sequence identified: ${config.id}`);
716717

717718
if (this.config.host.id) {
718719
// eslint-disable-next-line max-len
@@ -775,7 +776,7 @@ export class Host implements IComponent {
775776
this.sequenceStore.set({ id, config, instances: [], name: sequenceName, location: "STH" });
776777
}
777778

778-
if (development()) this.logger.trace(`Sequence identified: ${config.id}`);
779+
if (isDevelopment) this.logger.trace(`Sequence identified: ${config.id}`);
779780

780781
// eslint-disable-next-line max-len
781782
await this.cpmConnector?.sendSequenceInfo(id, SequenceMessageCode.SEQUENCE_CREATED, config as unknown as GetSequenceResponse);
@@ -971,7 +972,7 @@ export class Host implements IComponent {
971972
const communicationHandler = new CommunicationHandler();
972973
const id = payload.instanceId || IDProvider.generate();
973974

974-
this.logger.debug("CSIC start payload", payload);
975+
if (isDevelopment) this.logger.debug("CSIC start payload", payload);
975976

976977
const csic = new CSIController(id, sequence, payload, communicationHandler, this.config, this.instanceProxy);
977978

0 commit comments

Comments
 (0)