@@ -13,7 +13,7 @@ import { IntervalService } from "../../utils/interval.js";
1313type SupervisorSessionOptions = SupervisorClientCommonOptions & {
1414 queueConsumerEnabled ?: boolean ;
1515 runNotificationsEnabled ?: boolean ;
16- heartbeatIntervalSeconds ? : number ;
16+ heartbeatIntervalSeconds : number ;
1717 dequeueIntervalMs : number ;
1818 dequeueIdleIntervalMs : number ;
1919 preDequeue ?: PreDequeueFn ;
@@ -32,7 +32,6 @@ export class SupervisorSession extends EventEmitter<WorkerEvents> {
3232 private readonly queueConsumers : RunQueueConsumer [ ] ;
3333
3434 private readonly heartbeat : IntervalService ;
35- private readonly heartbeatIntervalSeconds : number ;
3635
3736 constructor ( private opts : SupervisorSessionOptions ) {
3837 super ( ) ;
@@ -53,7 +52,6 @@ export class SupervisorSession extends EventEmitter<WorkerEvents> {
5352 } ) ;
5453 } ) ;
5554
56- this . heartbeatIntervalSeconds = opts . heartbeatIntervalSeconds || 30 ;
5755 this . heartbeat = new IntervalService ( {
5856 onInterval : async ( ) => {
5957 console . debug ( "[SupervisorSession] Sending heartbeat" ) ;
@@ -65,7 +63,7 @@ export class SupervisorSession extends EventEmitter<WorkerEvents> {
6563 console . error ( "[SupervisorSession] Heartbeat failed" , { error : response . error } ) ;
6664 }
6765 } ,
68- intervalMs : this . heartbeatIntervalSeconds * 1000 ,
66+ intervalMs : opts . heartbeatIntervalSeconds * 1000 ,
6967 leadingEdge : false ,
7068 onError : async ( error ) => {
7169 console . error ( "[SupervisorSession] Failed to send heartbeat" , { error } ) ;
0 commit comments