File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed
rivetkit-typescript/packages/rivetkit/src Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -109,10 +109,10 @@ export class EngineActorDriver implements ActorDriver {
109109 version : this . #version,
110110 endpoint : getEndpoint ( runConfig ) ,
111111 token,
112- namespace : runConfig . namespace ?? runConfig . namespace ,
113- totalSlots : runConfig . totalSlots ?? runConfig . totalSlots ,
114- runnerName : runConfig . runnerName ?? runConfig . runnerName ,
115- runnerKey : runConfig . runnerKey ,
112+ namespace : runConfig . namespace ,
113+ totalSlots : runConfig . totalSlots ,
114+ runnerName : runConfig . runnerName ,
115+ runnerKey : runConfig . runnerKey ?? crypto . randomUUID ( ) ,
116116 metadata : {
117117 inspectorToken : this . #runConfig. inspector . token ( ) ,
118118 } ,
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