@514labs/moose-lib 0.6.260-ci-3-g63948580 → 0.6.260-ci-2-g1b93253f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browserCompatible.js +63 -4
- package/dist/browserCompatible.js.map +1 -1
- package/dist/browserCompatible.mjs +63 -4
- package/dist/browserCompatible.mjs.map +1 -1
- package/dist/compilerPlugin.js +73 -14
- package/dist/compilerPlugin.js.map +1 -1
- package/dist/compilerPlugin.mjs +73 -14
- package/dist/compilerPlugin.mjs.map +1 -1
- package/dist/dmv2/index.js +63 -4
- package/dist/dmv2/index.js.map +1 -1
- package/dist/dmv2/index.mjs +63 -4
- package/dist/dmv2/index.mjs.map +1 -1
- package/dist/index.d.mts +18 -2
- package/dist/index.d.ts +18 -2
- package/dist/index.js +80 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +79 -5
- package/dist/index.mjs.map +1 -1
- package/dist/moose-runner.js +86 -6
- package/dist/moose-runner.js.map +1 -1
- package/dist/moose-runner.mjs +86 -6
- package/dist/moose-runner.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ var __export = (target, all) => {
|
|
|
12
12
|
var commons_exports = {};
|
|
13
13
|
__export(commons_exports, {
|
|
14
14
|
ACKs: () => ACKs,
|
|
15
|
+
LogLevel: () => LogLevel,
|
|
15
16
|
MAX_RETRIES: () => MAX_RETRIES,
|
|
16
17
|
MAX_RETRIES_PRODUCER: () => MAX_RETRIES_PRODUCER,
|
|
17
18
|
MAX_RETRY_TIME_MS: () => MAX_RETRY_TIME_MS,
|
|
@@ -43,6 +44,36 @@ function isTruthy(value) {
|
|
|
43
44
|
return false;
|
|
44
45
|
}
|
|
45
46
|
}
|
|
47
|
+
function parseLogLevel(value) {
|
|
48
|
+
if (!value) return "Info" /* Info */;
|
|
49
|
+
const normalized = value.trim();
|
|
50
|
+
switch (normalized) {
|
|
51
|
+
case "Debug":
|
|
52
|
+
case "debug":
|
|
53
|
+
case "DEBUG":
|
|
54
|
+
return "Debug" /* Debug */;
|
|
55
|
+
case "Info":
|
|
56
|
+
case "info":
|
|
57
|
+
case "INFO":
|
|
58
|
+
return "Info" /* Info */;
|
|
59
|
+
case "Warn":
|
|
60
|
+
case "warn":
|
|
61
|
+
case "WARN":
|
|
62
|
+
return "Warn" /* Warn */;
|
|
63
|
+
case "Error":
|
|
64
|
+
case "error":
|
|
65
|
+
case "ERROR":
|
|
66
|
+
return "Error" /* Error */;
|
|
67
|
+
default:
|
|
68
|
+
return "Info" /* Info */;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function getLogLevel() {
|
|
72
|
+
if (cachedLogLevel === null) {
|
|
73
|
+
cachedLogLevel = parseLogLevel(process.env.MOOSE_LOGGER__LEVEL);
|
|
74
|
+
}
|
|
75
|
+
return cachedLogLevel;
|
|
76
|
+
}
|
|
46
77
|
function mapTstoJs(filePath) {
|
|
47
78
|
return filePath.replace(/\.ts$/, ".js").replace(/\.cts$/, ".cjs").replace(/\.mts$/, ".mjs");
|
|
48
79
|
}
|
|
@@ -68,13 +99,31 @@ async function getKafkaProducer(cfg, logger, maxMessageBytes) {
|
|
|
68
99
|
await producer.connect();
|
|
69
100
|
return producer;
|
|
70
101
|
}
|
|
71
|
-
var Kafka, compilerLog, antiCachePath, getFileName, getClickhouseClient, cliLog, MAX_RETRIES, MAX_RETRY_TIME_MS, RETRY_INITIAL_TIME_MS, MAX_RETRIES_PRODUCER, RETRY_FACTOR_PRODUCER, ACKs, parseBrokerString, logError, buildSaslConfig, getKafkaClient;
|
|
102
|
+
var Kafka, LogLevel, cachedLogLevel, compilerLog, antiCachePath, getFileName, getClickhouseClient, cliLog, MAX_RETRIES, MAX_RETRY_TIME_MS, RETRY_INITIAL_TIME_MS, MAX_RETRIES_PRODUCER, RETRY_FACTOR_PRODUCER, ACKs, parseBrokerString, logError, buildSaslConfig, getKafkaClient;
|
|
72
103
|
var init_commons = __esm({
|
|
73
104
|
"src/commons.ts"() {
|
|
74
105
|
"use strict";
|
|
75
106
|
({ Kafka } = KafkaJS);
|
|
76
|
-
|
|
77
|
-
|
|
107
|
+
LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
108
|
+
LogLevel2["Debug"] = "Debug";
|
|
109
|
+
LogLevel2["Info"] = "Info";
|
|
110
|
+
LogLevel2["Warn"] = "Warn";
|
|
111
|
+
LogLevel2["Error"] = "Error";
|
|
112
|
+
return LogLevel2;
|
|
113
|
+
})(LogLevel || {});
|
|
114
|
+
cachedLogLevel = null;
|
|
115
|
+
compilerLog = (message, level = "Debug" /* Debug */) => {
|
|
116
|
+
if (isTruthy(process.env.MOOSE_DISABLE_COMPILER_LOGS)) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const currentLevel = getLogLevel();
|
|
120
|
+
const levelPriority = {
|
|
121
|
+
["Debug" /* Debug */]: 0,
|
|
122
|
+
["Info" /* Info */]: 1,
|
|
123
|
+
["Warn" /* Warn */]: 2,
|
|
124
|
+
["Error" /* Error */]: 3
|
|
125
|
+
};
|
|
126
|
+
if (levelPriority[level] >= levelPriority[currentLevel]) {
|
|
78
127
|
console.log(message);
|
|
79
128
|
}
|
|
80
129
|
};
|
|
@@ -102,7 +151,17 @@ var init_commons = __esm({
|
|
|
102
151
|
username,
|
|
103
152
|
password,
|
|
104
153
|
database,
|
|
105
|
-
application: "moose"
|
|
154
|
+
application: "moose",
|
|
155
|
+
// Connection pool configuration for high load (100+ concurrent users)
|
|
156
|
+
max_open_connections: 50,
|
|
157
|
+
// Increased from default 10 to handle 100 concurrent users
|
|
158
|
+
request_timeout: 6e4,
|
|
159
|
+
// 60s timeout for HTTP requests (queries and inserts)
|
|
160
|
+
keep_alive: {
|
|
161
|
+
enabled: true,
|
|
162
|
+
idle_socket_ttl: 2e3
|
|
163
|
+
// 2s idle time (lower than default to prevent socket hang-ups)
|
|
164
|
+
}
|
|
106
165
|
// Note: wait_end_of_query is configured per operation type, not globally
|
|
107
166
|
// to preserve SELECT query performance while ensuring INSERT/DDL reliability
|
|
108
167
|
});
|