Schedule.after does not work

Once the action executed within the actor, I assigned a new action to be triggered 10 minutes later.

Action that creates the scheduled event
    setupChannels: (c, input: TInput & { channels: TServerChannel[] }) => {
      if (input?.password !== c.state.password) {
        throw new UserError("Access Denied", {
          code: "forbidden",
        });
      }

      c.state.channels = input.channels;

      c.schedule.after(10 * 60 * 1000, "destroyRoom", {
        password: c.state.password,
      });

      return c.state.channels;
    }


Action to be automatically executed
    destroyRoom: (c, input: TInput) => {
      if (input?.password !== c.state.password) {
        throw new UserError("Access Denied", {
          code: "forbidden",
        });
      }

      // Alert all connected devices the room will be destroyed
      c.broadcast("destroyRoom");

      c.state.channels = [];
      c.destroy();
    }


You can see on the picture actors are not getting deleted
image.png
Was this page helpful?