@sentio/runtime 2.57.13-rc.1 → 2.57.13-rc.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,20 +13,20 @@ declare const optionDefinitions: ({
13
13
  defaultOption?: undefined;
14
14
  } | {
15
15
  name: string;
16
- type: StringConstructor;
17
- defaultValue: string;
16
+ type: NumberConstructor;
17
+ defaultValue: number;
18
18
  defaultOption?: undefined;
19
19
  alias?: undefined;
20
20
  } | {
21
21
  name: string;
22
- type: BooleanConstructor;
23
- defaultValue: boolean;
22
+ type: StringConstructor;
23
+ defaultValue: string;
24
24
  defaultOption?: undefined;
25
25
  alias?: undefined;
26
26
  } | {
27
27
  name: string;
28
- type: NumberConstructor;
29
- defaultValue: string | number;
28
+ type: BooleanConstructor;
29
+ defaultValue: boolean;
30
30
  defaultOption?: undefined;
31
31
  alias?: undefined;
32
32
  })[];
@@ -26315,7 +26315,7 @@ var ServiceManager = class extends ProcessorServiceImpl {
26315
26315
  const binding = request3.binding;
26316
26316
  const dbContext = this.contexts.new(request3.processId, subject);
26317
26317
  const start = Date.now();
26318
- await this.process(binding, dbContext).then(async (result) => {
26318
+ this.process(binding, dbContext).then(async (result) => {
26319
26319
  subject.next({
26320
26320
  result,
26321
26321
  processId: request3.processId
@@ -26346,6 +26346,7 @@ var ServiceManager = class extends ProcessorServiceImpl {
26346
26346
  if (this.pool) {
26347
26347
  await this.pool.close();
26348
26348
  }
26349
+ console.info("Initializing worker pool with worker count:", this.options.worker);
26349
26350
  this.pool = new Piscina({
26350
26351
  maxThreads: this.options.worker,
26351
26352
  minThreads: this.options.worker,
@@ -26419,6 +26420,12 @@ var ChannelStoreContext = class {
26419
26420
  import("node:process").then((p) => p.stdout.write(""));
26420
26421
 
26421
26422
  // src/processor-runner.ts
26423
+ var workerNum = 1;
26424
+ try {
26425
+ workerNum = parseInt(process.env["PROCESSOR_WORKER"]?.trim() ?? "1");
26426
+ } catch (e) {
26427
+ console.error("Failed to parse worker number", e);
26428
+ }
26422
26429
  var optionDefinitions = [
26423
26430
  { name: "target", type: String, defaultOption: true },
26424
26431
  { name: "port", alias: "p", type: String, defaultValue: "4000" },
@@ -26437,7 +26444,7 @@ var optionDefinitions = [
26437
26444
  { name: "debug", type: Boolean, defaultValue: false },
26438
26445
  { name: "otlp-debug", type: Boolean, defaultValue: false },
26439
26446
  { name: "start-action-server", type: Boolean, defaultValue: false },
26440
- { name: "worker", type: Number, defaultValue: process.env["PROCESSOR_WORKER"] ?? 1 }
26447
+ { name: "worker", type: Number, defaultValue: workerNum }
26441
26448
  ];
26442
26449
  var options = command_line_args_default(optionDefinitions, { partial: true });
26443
26450
  var logLevel = process.env["LOG_LEVEL"]?.toLowerCase();