File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed
rivetkit-typescript/packages/rivetkit/src Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ export class EngineActorDriver implements ActorDriver {
9999
100100 // HACK: Override inspector token (which are likely to be
101101 // removed later on) with token from x-rivet-token header
102- const token = runConfig . token ?? runConfig . token ;
102+ const token = runConfig . token ;
103103 if ( token && runConfig . inspector && runConfig . inspector . enabled ) {
104104 runConfig . inspector . token = ( ) => token ;
105105 }
@@ -116,10 +116,10 @@ export class EngineActorDriver implements ActorDriver {
116116 version : this . #version,
117117 endpoint : getEndpoint ( runConfig ) ,
118118 token,
119- namespace : runConfig . namespace ?? runConfig . namespace ,
120- totalSlots : runConfig . totalSlots ?? runConfig . totalSlots ,
121- runnerName : runConfig . runnerName ?? runConfig . runnerName ,
122- runnerKey : runConfig . runnerKey ,
119+ namespace : runConfig . namespace ,
120+ totalSlots : runConfig . totalSlots ,
121+ runnerName : runConfig . runnerName ,
122+ runnerKey : runConfig . runnerKey ?? crypto . randomUUID ( ) ,
123123 metadata : {
124124 inspectorToken : this . #runConfig. inspector . token ( ) ,
125125 } ,
Original file line number Diff line number Diff line change @@ -7,10 +7,8 @@ export const EngingConfigSchema = z
77 /** Unique key for this runner. Runners connecting a given key will replace any other runner connected with the same key. */
88 runnerKey : z
99 . string ( )
10- . default (
11- ( ) =>
12- getEnvUniversal ( "RIVET_RUNNER_KEY" ) ?? crypto . randomUUID ( ) ,
13- ) ,
10+ . optional ( )
11+ . transform ( ( x ) => x ?? getEnvUniversal ( "RIVET_RUNNER_KEY" ) ) ,
1412
1513 /** How many actors this runner can run. */
1614 totalSlots : z . number ( ) . default ( 100_000 ) ,
Original file line number Diff line number Diff line change @@ -186,6 +186,13 @@ function addServerlessRoutes(
186186 newRunConfig . totalSlots = totalSlots ;
187187 newRunConfig . runnerName = runnerName ;
188188 newRunConfig . namespace = namespace ;
189+ if ( newRunConfig . runnerKey ) {
190+ logger ( ) . warn ( {
191+ msg : "runner keys are not supported by serverless runners, this will be overwritten with a random runner key" ,
192+ oldRunnerKey : newRunConfig . runnerKey ,
193+ } ) ;
194+ newRunConfig . runnerKey = undefined ;
195+ }
189196
190197 // Create new actor driver with updated config
191198 const actorDriver = driverConfig . actor (
You can’t perform that action at this time.
0 commit comments