(ctx: &ReducerContext)
| 227 | |
| 228 | #[spacetimedb::reducer(init)] |
| 229 | pub fn init(ctx: &ReducerContext) { |
| 230 | ctx.db.repeating_test_arg().insert(RepeatingTestArg { |
| 231 | prev_time: ctx.timestamp, |
| 232 | scheduled_id: 0, |
| 233 | scheduled_at: duration!("1000ms").into(), |
| 234 | }); |
| 235 | |
| 236 | let current_time = ctx.timestamp; |
| 237 | let one_second = TimeDuration::from_micros(1_000_000); |
| 238 | let future_timestamp: Timestamp = current_time + one_second; |
| 239 | |
| 240 | ctx.db.nonrepeating_test_arg().insert(NonrepeatingTestArg { |
| 241 | prev_time: ctx.timestamp, |
| 242 | scheduled_id: 1, |
| 243 | scheduled_at: future_timestamp.into(), |
| 244 | }); |
| 245 | } |
| 246 | |
| 247 | #[spacetimedb::reducer] |
| 248 | pub fn repeating_test(ctx: &ReducerContext, arg: RepeatingTestArg) { |
searching dependent graphs…