server-socket-framework-jps
Advanced tools
Comparing version 1.1.6 to 1.1.7
import { JobConfig, JobError, JobListener, JobStatus } from "./Job"; | ||
export declare class JobManager { | ||
private static _instance; | ||
private interval; | ||
static getInstance(): JobManager; | ||
@@ -5,0 +6,0 @@ private constructor(); |
@@ -10,2 +10,3 @@ "use strict"; | ||
const uuid_1 = require("uuid"); | ||
const timers_1 = require("timers"); | ||
const logger = (0, debug_1.default)('job-manager'); | ||
@@ -15,2 +16,3 @@ const loggerDetail = (0, debug_1.default)('job-manager-detail'); | ||
constructor() { | ||
this.interval = undefined; | ||
this.listeners = []; | ||
@@ -21,2 +23,4 @@ this.jobQueue = []; | ||
this.jobCallback = this.jobCallback.bind(this); | ||
this.start = this.start.bind(this); | ||
this.stop = this.stop.bind(this); | ||
} | ||
@@ -32,6 +36,10 @@ static getInstance() { | ||
logger(`Starting job manager`); | ||
setInterval(this.runJobs, 60000); | ||
this.interval = setInterval(this.runJobs, 60000); | ||
} | ||
stop() { | ||
this.processJobs = false; | ||
if (this.interval) { | ||
(0, timers_1.clearInterval)(this.interval); | ||
this.interval = undefined; | ||
} | ||
logger(`Stop processing of job queue`); | ||
@@ -38,0 +46,0 @@ } |
{ | ||
"name": "server-socket-framework-jps", | ||
"version": "1.1.6", | ||
"version": "1.1.7", | ||
"description": "A simple socket framework for persistent chat rooms and data messages", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
83199
1163