@iterativeflow/mysql 2.0.0-alpha.2 → 2.0.0-alpha.4
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.
- package/dist/index.mjs +4 -0
- 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.
|
|
3
|
+
"version": "2.0.0-alpha.4",
|
|
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.
|
|
31
|
+
"@iterativeflow/core": "2.0.0-alpha.4"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"mysql2": ">=3.0.0"
|