@iterativeflow/mysql 2.0.0-alpha.2 → 2.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +4 -0
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -550,6 +550,10 @@ const createMysqlTimer = (sql, t) => {
550
550
  },
551
551
  async cancel(runId) {
552
552
  await sql.exec(`DELETE FROM ${t.timer} WHERE run_id = ?`, [runId]);
553
+ },
554
+ async nextDueAt(now) {
555
+ const at = (await sql.query(`SELECT min(fire_at) AS fire_at FROM ${t.timer} WHERE fire_at > ?`, [now.getTime()]))[0]?.fire_at;
556
+ return at == null ? null : new Date(Number(at));
553
557
  }
554
558
  };
555
559
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iterativeflow/mysql",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.3",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,7 +28,7 @@
28
28
  "build": "tsdown"
29
29
  },
30
30
  "dependencies": {
31
- "@iterativeflow/core": "2.0.0-alpha.2"
31
+ "@iterativeflow/core": "2.0.0-alpha.3"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "mysql2": ">=3.0.0"