@514labs/moose-lib
Advanced tools
Comparing version 0.3.704 to 0.3.705
@@ -484,3 +484,4 @@ #!/usr/bin/env node | ||
}; | ||
var apiHandler = (publicKey) => (req, res) => __async(void 0, null, function* () { | ||
var modulesCache = /* @__PURE__ */ new Map(); | ||
var apiHandler = (publicKey, clickhouseClient) => (req, res) => __async(void 0, null, function* () { | ||
var _a; | ||
@@ -537,8 +538,9 @@ try { | ||
); | ||
const userFuncModule = require(pathName); | ||
let userFuncModule = modulesCache.get(pathName); | ||
if (userFuncModule === void 0) { | ||
userFuncModule = require(pathName); | ||
modulesCache.set(pathName, userFuncModule); | ||
} | ||
const result = yield userFuncModule.default(paramsObject, { | ||
client: new MooseClient( | ||
getClickhouseClient(clickhouseConfig3), | ||
fileName | ||
), | ||
client: new MooseClient(clickhouseClient, fileName), | ||
sql, | ||
@@ -582,2 +584,3 @@ jwt: jwtPayload | ||
console.log("Starting API service"); | ||
const clickhouseClient = getClickhouseClient(clickhouseConfig3); | ||
let publicKey; | ||
@@ -588,3 +591,3 @@ if (JWT_SECRET) { | ||
} | ||
const server = import_http2.default.createServer(apiHandler(publicKey)); | ||
const server = import_http2.default.createServer(apiHandler(publicKey, clickhouseClient)); | ||
import_node_process3.default.on("SIGTERM", () => __async(void 0, null, function* () { | ||
@@ -591,0 +594,0 @@ console.log("Received SIGTERM, shutting down..."); |
{ | ||
"name": "@514labs/moose-lib", | ||
"version": "0.3.704", | ||
"version": "0.3.705", | ||
"main": "./dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "./dist/index.mjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
285016
3148