IO-117 PBS WIP

This commit is contained in:
Patrick Fic
2021-11-09 10:38:07 -08:00
parent bef9e64bf8
commit 6017e2172e
13 changed files with 482 additions and 58 deletions

View File

@@ -17,7 +17,7 @@ const CdkCalculateAllocations =
require("../cdk/cdk-calculate-allocations").default;
const { isArray } = require("lodash");
const logger = require("../utils/logger");
const PbsExportJob = require("../accounting/pbs/pbs-job-export");
const PbsExportJob = require("../accounting/pbs/pbs-job-export").default;
io.use(function (socket, next) {
try {
@@ -99,6 +99,17 @@ io.on("connection", (socket) => {
//END CDK
//PBS
socket.on("pbs-calculate-allocations", async (jobid, callback) => {
const allocations = await CdkCalculateAllocations(socket, jobid);
createLogEvent(socket, "DEBUG", `Allocations calculated.`);
createLogEvent(
socket,
"TRACE",
`Allocations calculated. ${JSON.stringify(allocations, null, 2)}`
);
callback(allocations);
});
socket.on("pbs-export-job", (jobid) => {
PbsExportJob(socket, jobid);
});