@@ -230,6 +230,9 @@ impl spacetimedb_client_api::ControlStateWriteAccess for StandaloneEnv {
230
230
) -> anyhow:: Result < Option < UpdateDatabaseResult > > {
231
231
let existing_db = self . control_db . get_database_by_identity ( & spec. database_identity ) ?;
232
232
233
+ // standalone does not support replication.
234
+ let num_replicas = 1 ;
235
+
233
236
match existing_db {
234
237
// The database does not already exist, so we'll create it.
235
238
None => {
@@ -258,7 +261,7 @@ impl spacetimedb_client_api::ControlStateWriteAccess for StandaloneEnv {
258
261
let database_id = self . control_db . insert_database ( database. clone ( ) ) ?;
259
262
database. id = database_id;
260
263
261
- self . schedule_replicas ( database_id, spec . num_replicas ) . await ?;
264
+ self . schedule_replicas ( database_id, num_replicas) . await ?;
262
265
263
266
Ok ( None )
264
267
}
@@ -275,7 +278,6 @@ impl spacetimedb_client_api::ControlStateWriteAccess for StandaloneEnv {
275
278
let database_id = database. id ;
276
279
let database_identity = database. database_identity ;
277
280
278
- let num_replicas = spec. num_replicas ;
279
281
let leader = self
280
282
. leader ( database_id)
281
283
. await ?
@@ -416,7 +418,7 @@ impl StandaloneEnv {
416
418
Ok ( ( ) )
417
419
}
418
420
419
- async fn schedule_replicas ( & self , database_id : u64 , num_replicas : u32 ) -> Result < ( ) , anyhow:: Error > {
421
+ async fn schedule_replicas ( & self , database_id : u64 , num_replicas : u8 ) -> Result < ( ) , anyhow:: Error > {
420
422
// Just scheduling a bunch of replicas to the only machine
421
423
for i in 0 ..num_replicas {
422
424
let replica = Replica {
0 commit comments