@@ -9,6 +9,7 @@ import type { WebSocketTunnelAdapter } from "./websocket-tunnel-adapter";
99
1010const KV_EXPIRE : number = 30_000 ;
1111const PROTOCOL_VERSION : number = 2 ;
12+ const RUNNER_PING_INTERVAL = 3_000 ;
1213
1314/** Warn once the backlog significantly exceeds the server's ack batch size. */
1415const EVENT_BACKLOG_WARN_THRESHOLD = 10_000 ;
@@ -64,7 +65,11 @@ export interface RunnerConfig {
6465 config : ActorConfig ,
6566 ) => Promise < void > ;
6667 onActorStop : ( actorId : string , generation : number ) => Promise < void > ;
67- getActorHibernationConfig : ( actorId : string , requestId : ArrayBuffer , request : Request ) => HibernationConfig ;
68+ getActorHibernationConfig : (
69+ actorId : string ,
70+ requestId : ArrayBuffer ,
71+ request : Request ,
72+ ) => HibernationConfig ;
6873 noAutoShutdown ?: boolean ;
6974}
7075
@@ -250,7 +255,6 @@ export class Runner {
250255
251256 this . #actors. delete ( actorId ) ;
252257
253-
254258 return actor ;
255259 }
256260
@@ -510,7 +514,6 @@ export class Runner {
510514 this . #processUnsentKvRequests( ) ;
511515
512516 // Start ping interval
513- const pingInterval = 1000 ;
514517 const pingLoop = setInterval ( ( ) => {
515518 if ( ws . readyState === 1 ) {
516519 this . __sendToServer ( {
@@ -526,7 +529,7 @@ export class Runner {
526529 runnerId : this . runnerId ,
527530 } ) ;
528531 }
529- } , pingInterval ) ;
532+ } , RUNNER_PING_INTERVAL ) ;
530533 this . #pingLoop = pingLoop ;
531534
532535 // Start command acknowledgment interval (5 minutes)
0 commit comments