@ai-ecoverse/slicc-kernel 1.116.0 → 1.116.1
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/README.md +1 -1
- package/dist/kernel-worker.js +20 -2
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-process-worker.js +1 -1
- package/dist/node.js +20 -2
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +1 -1
- package/dist/types/cron/schedule.d.ts +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -802,7 +802,7 @@ The kernel runs scheduled jobs itself, with no daemon process: a cron service st
|
|
|
802
802
|
- **`crontab`** is a command of the kernel itself, in `/usr/bin` (a package's `crontab` never wins over it), with Vixie's options: `crontab -l` prints the caller's table, `crontab -r` removes it, `crontab <file>` and `crontab -` (standard input) install one, and `crontab -e` copies the table to `/tmp`, runs `$VISUAL` (or `$EDITOR`) on the copy through `/bin/bash -c '<editor> "$1"'`, and installs it if it changed and the editor exited with 0. If the edit doesn't parse, the copy is kept and its path is printed. `-u <user>` works on another user's table and needs an effective uid of 0 (`sudo crontab -u cone -l`). An install is checked first: a table with a line that doesn't parse is refused with every error (`"-":<line>: <message>`), and the old one stays. The table becomes the user's `0600` file in the spool, written to a dotfile of a random name and renamed, so the service, which skips dotfiles, never reads half a table. The command only reads the file it is given and passes it on (`ctx.crontab`, see [JS programs](#js-programs)). The kernel decides whose table it is from the caller's real uid, so a user reaches only their own table, and `/etc/crontab` stays root's to edit.
|
|
803
803
|
- **Format:** Vixie's. Five fields (minute, hour, day of month, month, weekday) with lists, ranges, steps and the names `jan`–`dec` and `sun`–`sat` (7 is Sunday too), or one of `@yearly`/`@annually`, `@monthly`, `@weekly`, `@daily`/`@midnight`, `@hourly` and `@reboot`. As in cronie, when the day of month or the weekday starts with `*`, a day must match both fields; when both are restricted, it may match either. `/etc/crontab` has a user field after the schedule; a user's table doesn't. `NAME=value` lines set the environment for the jobs after them, `#` lines are comments, and `# name: <id>` on the line above a job gives it a stable id (letters, digits, `_`, `.`, `-`), which names its log. Without one, the id is a hash of the table, the user, the schedule and the command. `%` is not special. Times are the kernel's local time.
|
|
804
804
|
- **Environment:** only what a login of that user gets, and nothing from the page or the embedder's `env`. That is `HOME`, `USER`, `LOGNAME`, `PATH`, `PNPM_HOME`, `NPM_CONFIG_PREFIX`, the kernel's network settings (`http_proxy`, `SSL_CERT_FILE`, …), `SHELL`, `PWD`, the table's `NAME=value` lines, and `SLICC_CRON=1`, `SLICC_CRON_JOB=<id>`, `SLICC_CRON_DUE=<ISO time of the due run>` and `SLICC_CRON_MISSED=<runs folded into this one>`. An `agent send` from a job therefore knows it was scheduled.
|
|
805
|
-
- **Missed runs:** when the kernel wasn't running (a closed tab) or time jumped forward, every due run since the last one is folded into **one** run, with `SLICC_CRON_MISSED` saying how many more were due (counted up to 100 000). The next run is then computed from now. A clock set back more than two minutes runs nothing until the next due time after the new time.
|
|
805
|
+
- **Missed runs:** when the kernel wasn't running (a closed tab) or time jumped forward, every due run since the last one is folded into **one** run, with `SLICC_CRON_MISSED` saying how many more were due (counted up to 100 000) and `SLICC_CRON_DUE` naming the latest due time, even past the count's cap ([#843](https://github.com/ai-ecoverse/slicc-kernel/issues/843)). The next run is then computed from now. A clock set back more than two minutes runs nothing until the next due time after the new time.
|
|
806
806
|
- **At most once:** the service writes each due run to `/var/spool/cron/stamp` before it starts the job. A kernel that ends mid-job (a reload, a crash) never runs that due again; a stamp that can't be read counts every job as run just now.
|
|
807
807
|
- **`@reboot`** runs once per kernel boot, when that kernel first fires jobs.
|
|
808
808
|
- **Overlap:** a job's runs don't wait for each other, so a slow job can still be running when it is due again. At most 16 jobs of one user run at once; a run past that is skipped, with a line in the job's log and in `/var/log/cron/cron.err`.
|
package/dist/kernel-worker.js
CHANGED
|
@@ -6241,7 +6241,7 @@ function satisfies(version, range2) {
|
|
|
6241
6241
|
}
|
|
6242
6242
|
|
|
6243
6243
|
// src/version.ts
|
|
6244
|
-
var KERNEL_VERSION = true ? "1.116.
|
|
6244
|
+
var KERNEL_VERSION = true ? "1.116.1" : "0.0.0-dev";
|
|
6245
6245
|
var OS_RELEASE = "6.0.0-slicc";
|
|
6246
6246
|
function procVersion() {
|
|
6247
6247
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|
|
@@ -6889,7 +6889,25 @@ function missedFires(schedule, from, until, utc = false, cap = MISSED_CAP) {
|
|
|
6889
6889
|
count2++;
|
|
6890
6890
|
}
|
|
6891
6891
|
const next3 = nextFire(schedule, last, utc);
|
|
6892
|
-
return { count: count2, last, more:
|
|
6892
|
+
if (next3 === null || next3 > until) return { count: count2, last, more: false };
|
|
6893
|
+
return { count: count2, last: latestFire(schedule, last, until, utc), more: true };
|
|
6894
|
+
}
|
|
6895
|
+
function latestFire(schedule, from, until, utc = false) {
|
|
6896
|
+
let found = from;
|
|
6897
|
+
for (let span = 6e4; ; span *= 2) {
|
|
6898
|
+
const start2 = Math.max(from, until - span);
|
|
6899
|
+
const first = nextFire(schedule, start2, utc);
|
|
6900
|
+
if (first !== null && first <= until) {
|
|
6901
|
+
found = first;
|
|
6902
|
+
break;
|
|
6903
|
+
}
|
|
6904
|
+
if (start2 === from) return from;
|
|
6905
|
+
}
|
|
6906
|
+
for (let at = nextFire(schedule, found, utc); at !== null && at <= until; ) {
|
|
6907
|
+
found = at;
|
|
6908
|
+
at = nextFire(schedule, at, utc);
|
|
6909
|
+
}
|
|
6910
|
+
return found;
|
|
6893
6911
|
}
|
|
6894
6912
|
|
|
6895
6913
|
// src/cron/table.ts
|