@ofirdagan/pingdom
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -1,1 +0,1 @@ | ||
export declare function init(serviceName: string): void; | ||
export declare function monitor(serviceName: string): void; |
@@ -6,11 +6,13 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.init = void 0; | ||
exports.monitor = void 0; | ||
const axios_1 = __importDefault(require("axios")); | ||
const THREE_MIN = 1000 * 60 * 3; | ||
function init(serviceName) { | ||
setInterval(() => { | ||
axios_1.default.get(`https://ofird11.editorx.io/pingdom/_functions/ping/${serviceName}`); | ||
}, THREE_MIN); | ||
function monitor(serviceName) { | ||
reportAlive(serviceName); | ||
setInterval(() => reportAlive(serviceName), THREE_MIN); | ||
} | ||
exports.init = init; | ||
exports.monitor = monitor; | ||
function reportAlive(serviceName) { | ||
axios_1.default.get(`https://ofird11.editorx.io/pingdom/_functions/ping/${serviceName}`); | ||
} | ||
//# sourceMappingURL=pingdom.js.map |
{ | ||
"name": "@ofirdagan/pingdom", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "my own lightweight version of pingdom (service monitoring)", | ||
@@ -5,0 +5,0 @@ "main": "dist/pingdom.js", |
@@ -5,6 +5,9 @@ import axios from 'axios'; | ||
export function init(serviceName: string) { | ||
setInterval(() => { | ||
axios.get(`https://ofird11.editorx.io/pingdom/_functions/ping/${serviceName}`); | ||
}, THREE_MIN); | ||
export function monitor(serviceName: string) { | ||
reportAlive(serviceName); | ||
setInterval(() => reportAlive(serviceName), THREE_MIN); | ||
} | ||
function reportAlive(serviceName: string) { | ||
axios.get(`https://ofird11.editorx.io/pingdom/_functions/ping/${serviceName}`); | ||
} |
@@ -1,3 +0,3 @@ | ||
import {init} from '../src/pingdom'; | ||
import {monitor} from '../src/pingdom'; | ||
init('test'); | ||
monitor('test'); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3043
44