@deckasoft/waify 0.5.1 → 0.6.0
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/cli/index.js +19 -4
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1676,6 +1676,19 @@ var registerPrompt = (program2) => {
|
|
|
1676
1676
|
|
|
1677
1677
|
// src/cli/commands/schedule.ts
|
|
1678
1678
|
init_schedule();
|
|
1679
|
+
init_paths();
|
|
1680
|
+
import { spawnSync as spawnSync3 } from "child_process";
|
|
1681
|
+
var restartScheduler = () => {
|
|
1682
|
+
console.warn("restarting scheduler\u2026");
|
|
1683
|
+
const result = spawnSync3("docker", ["compose", "-f", composePath(), "restart", "scheduler"], {
|
|
1684
|
+
stdio: "inherit"
|
|
1685
|
+
});
|
|
1686
|
+
if (result.status !== 0) {
|
|
1687
|
+
console.warn(
|
|
1688
|
+
`warning: scheduler restart failed \u2014 run manually: docker compose -f ${composePath()} restart scheduler`
|
|
1689
|
+
);
|
|
1690
|
+
}
|
|
1691
|
+
};
|
|
1679
1692
|
var registerSchedule = (program2) => {
|
|
1680
1693
|
const schedule = program2.command("schedule").description("Manage Ofelia scheduled jobs");
|
|
1681
1694
|
schedule.command("list").description("List all scheduled jobs").action(() => {
|
|
@@ -1689,14 +1702,16 @@ var registerSchedule = (program2) => {
|
|
|
1689
1702
|
`);
|
|
1690
1703
|
});
|
|
1691
1704
|
});
|
|
1692
|
-
schedule.command("add <name> <cron>").description('Add a new job. <cron> uses 6-field syntax (sec min hour dom month dow), e.g. "0 0 9 * * *"').option("-c, --command <cmd>", "command for the sender container to run", "send").action((name, cron, { command }) => {
|
|
1705
|
+
schedule.command("add <name> <cron>").description('Add a new job. <cron> uses 6-field syntax (sec min hour dom month dow), e.g. "0 0 9 * * *"').option("-c, --command <cmd>", "command for the sender container to run", "send").option("--no-restart", "skip automatic scheduler restart").action((name, cron, { command, restart }) => {
|
|
1693
1706
|
const job = ScheduledJobSchema.parse({ name, schedule: cron, command });
|
|
1694
1707
|
addJob(job);
|
|
1695
|
-
console.warn(`added job "${name}"
|
|
1708
|
+
console.warn(`added job "${name}"`);
|
|
1709
|
+
if (restart) restartScheduler();
|
|
1696
1710
|
});
|
|
1697
|
-
schedule.command("remove <name>").description("Remove a job by name").action((name) => {
|
|
1711
|
+
schedule.command("remove <name>").description("Remove a job by name").option("--no-restart", "skip automatic scheduler restart").action((name, { restart }) => {
|
|
1698
1712
|
removeJob(name);
|
|
1699
|
-
console.warn(`removed job "${name}"
|
|
1713
|
+
console.warn(`removed job "${name}"`);
|
|
1714
|
+
if (restart) restartScheduler();
|
|
1700
1715
|
});
|
|
1701
1716
|
};
|
|
1702
1717
|
|