Skip to content

Commit 3219020

Browse files
committed
Merge remote-tracking branch 'origin/phoebe/tpcc-distributed-naive-http-requests' into phoebe/tpcc/reducer-return-value
Manually resolved conflicts in the module and loader related to removing `spacetimedb_uri`.
2 parents e44225f + 3050d7d commit 3219020

23 files changed

Lines changed: 2480 additions & 411 deletions

modules/tpcc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ crate-type = ["cdylib"]
99
[dependencies]
1010
anyhow.workspace = true
1111
log.workspace = true
12-
spacetimedb = { workspace = true, features = ["unstable"] }
12+
spacetimedb = { workspace = true, features = ["unstable", "rand"] }
1313
spacetimedb-sats = { workspace = true, features = ["serde"] }
1414
http.workspace = true
1515
serde_json.workspace = true

modules/tpcc/src/lib.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use remote::reset_remote_warehouses;
21
use spacetimedb::{
32
log_stopwatch::LogStopwatch, reducer, table, ReducerContext, ScheduleAt, SpacetimeType, Table, Timestamp,
43
};
@@ -12,6 +11,7 @@ macro_rules! ensure {
1211
};
1312
}
1413

14+
mod load;
1515
mod new_order;
1616
mod payment;
1717
mod remote;
@@ -310,6 +310,12 @@ pub struct DeliveryCompletion {
310310

311311
#[reducer]
312312
pub fn reset_tpcc(ctx: &ReducerContext) -> Result<(), String> {
313+
clear_tpcc_business_tables(ctx);
314+
load::clear_load_metadata(ctx);
315+
Ok(())
316+
}
317+
318+
pub(crate) fn clear_tpcc_business_tables(ctx: &ReducerContext) {
313319
for row in ctx.db.delivery_job().iter() {
314320
ctx.db.delivery_job().delete(row);
315321
}
@@ -343,8 +349,6 @@ pub fn reset_tpcc(ctx: &ReducerContext) -> Result<(), String> {
343349
for row in ctx.db.warehouse().iter() {
344350
ctx.db.warehouse().delete(row);
345351
}
346-
reset_remote_warehouses(ctx);
347-
Ok(())
348352
}
349353

350354
#[reducer]

0 commit comments

Comments
 (0)