@sentio/runtime 2.57.13-rc.1 → 2.57.13-rc.2
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.
package/package.json
CHANGED
package/src/processor-runner.ts
CHANGED
@@ -24,6 +24,12 @@ import { ServiceManager } from './service-manager.js'
|
|
24
24
|
|
25
25
|
// const mergedRegistry = Registry.merge([globalRegistry, niceGrpcRegistry])
|
26
26
|
|
27
|
+
let workerNum = 1
|
28
|
+
try {
|
29
|
+
workerNum = parseInt(process.env['PROCESSOR_WORKER']?.trim() ?? '1')
|
30
|
+
} catch (e) {
|
31
|
+
console.error('Failed to parse worker number', e)
|
32
|
+
}
|
27
33
|
export const optionDefinitions = [
|
28
34
|
{ name: 'target', type: String, defaultOption: true },
|
29
35
|
{ name: 'port', alias: 'p', type: String, defaultValue: '4000' },
|
@@ -42,7 +48,7 @@ export const optionDefinitions = [
|
|
42
48
|
{ name: 'debug', type: Boolean, defaultValue: false },
|
43
49
|
{ name: 'otlp-debug', type: Boolean, defaultValue: false },
|
44
50
|
{ name: 'start-action-server', type: Boolean, defaultValue: false },
|
45
|
-
{ name: 'worker', type: Number, defaultValue:
|
51
|
+
{ name: 'worker', type: Number, defaultValue: workerNum }
|
46
52
|
]
|
47
53
|
|
48
54
|
const options = commandLineArgs(optionDefinitions, { partial: true })
|
package/src/service-manager.ts
CHANGED
@@ -144,6 +144,7 @@ export class ServiceManager extends ProcessorServiceImpl {
|
|
144
144
|
if (this.pool) {
|
145
145
|
await this.pool.close()
|
146
146
|
}
|
147
|
+
console.info('Initializing worker pool with worker count:', this.options.worker)
|
147
148
|
this.pool = new Piscina({
|
148
149
|
maxThreads: this.options.worker,
|
149
150
|
minThreads: this.options.worker,
|