1.2.3 • Published 5 years ago

node-docker-watchdog v1.2.3

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

node-docker-watchdog

Simple watchdog. For node&docker friendship forever. No more stalled loop.

Healthcheck script

const watchdog = require("node-docker-watchdog");

watchdog.CliWatchdogHealthcheck({
    project: "wise-hub",
    environment: "production",
});

Watchdog in looping server:

import { DockerWatchdogServer, TimeWatchdogStrategy } from "node-docker-watchdog";

const timeWatchdogA = new TimeWatchdogStrategy().setIdentitier("timeWatchdogA");
const timeWatchdogB = new TimeWatchdogStrategy().setIdentitier("timeWatchdogB");
const watchdogServer = new DockerWatchdogServer([timeWatchdogA, timeWatchdogB]);

(async () => {
    await watchdogServer.listen();

    recurrentLoopFn();
})();

function recurrentLoopFn() {
    console.log("beat 20000ms");
    timeWatchdogA.beat(14000);
    timeWatchdogB.beat(8000);
    setTimeout(() => recurrentLoopFn(), 20000);
}
1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago