Picolab / Picolab/pico-engine

`schedule event at` when chained behaves oddly

Open
#554 4 comments 0 reactions 2 assignees View on GitHub

@b1conrad is already working on this.

Since Mar 9, 2021.

bug question
Dominant language
TypeScript
Stars
51
Forks
10
Avg merge
4m
Merged PRs (30d)
1

Description

These are the times for the bofm:verse_needed event:

2021-03-08T22:36:33.951
2021-03-08T22:37:34.351
2021-03-08T22:38:34.751
2021-03-08T22:39:35.162
2021-03-08T22:40:35.545
2021-03-08T22:41:35.967
2021-03-08T22:42:36.373
2021-03-08T22:43:36.788
2021-03-08T22:44:37.188
2021-03-08T22:45:37.570
2021-03-08T22:46:37.973
2021-03-08T22:47:38.409
2021-03-08T22:48:38.795
2021-03-08T22:49:39.311
2021-03-08T22:50:39.688
2021-03-08T22:51:40.069
2021-03-08T22:52:40.456
2021-03-08T22:53:40.828
2021-03-08T23:27:38.030
2021-03-09T00:10:07.829
2021-03-09T00:11:08.418
2021-03-09T00:12:08.807

Where the code is

  rule bofm_verse_needed {
    select when bofm verse_needed
    pre {
      v = bofm:verse();
    }
    fired {
      raise bofm event "schedule_bump";
      raise bofm event "verse_to_route" attributes v;
    }
  }
  rule bofm_schedule_bump {
    select when bofm schedule_bump
    fired {
      schedule bofm event "verse_needed" at time:add(time:now(), {"minutes": ent:minutes})
        setting(schedule_id);
      ent:schedule_id := schedule_id;
    }
  }

Notice that it stopped and then started again, twice. How does this happen?

ent:minutes is set to 1 and left unchanged throughout

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.