querysub 0.387.0 → 0.389.0
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/package.json
CHANGED
|
@@ -863,18 +863,18 @@ export async function machineApplyMain() {
|
|
|
863
863
|
onServiceConfigChange(resyncServices);
|
|
864
864
|
|
|
865
865
|
runInfinitePoll(timeInMinute, async () => {
|
|
866
|
-
console.log(magenta(`Quick outdated check at ${new Date().toISOString()}`));
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
} else {
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
}
|
|
866
|
+
//console.log(magenta(`Quick outdated check at ${new Date().toISOString()}`));
|
|
867
|
+
// console.log(magenta("Likely outdated, resyncing now"));
|
|
868
|
+
// NOTE: I'm not sure why we were hesitant to call this. It shouldn't be that slow...
|
|
869
|
+
await resyncServices();
|
|
870
|
+
// } else {
|
|
871
|
+
// let config = await machineInfos.get(getOwnMachineId());
|
|
872
|
+
// if (config) {
|
|
873
|
+
// config.heartbeat = Date.now();
|
|
874
|
+
// console.log(magenta(`Updating heartbeat for ${getOwnMachineId()} to ${config.heartbeat}`));
|
|
875
|
+
// await machineInfos.set(getOwnMachineId(), config);
|
|
876
|
+
// }
|
|
877
|
+
// }
|
|
878
878
|
});
|
|
879
879
|
|
|
880
880
|
runInfinitePoll(timeInMinute, async () => {
|
|
@@ -201,6 +201,10 @@ Please provide a SHORT search string that would match this type of error. The st
|
|
|
201
201
|
- Be generic enough to match similar errors (avoid dynamic values like timestamps, IDs, or specific numbers)
|
|
202
202
|
- Be a simple substring (no special operators)
|
|
203
203
|
|
|
204
|
+
DO NOT include variables. If something is some dynamic path that includes numbers, etc., definitely do not include that in the match pattern. That is a very, very bad match pattern.
|
|
205
|
+
|
|
206
|
+
The string must be exactly included. You can't stitch together pieces, it will be checked for with .includes() in javascript.
|
|
207
|
+
|
|
204
208
|
Respond with a JSON object with a "pattern" field containing the search string.`;
|
|
205
209
|
|
|
206
210
|
const response = await callOpenRouterJSON<PatternResponse>(openRouterAPIKey, prompt);
|
|
@@ -303,54 +307,58 @@ export async function exposeErrorWatchService() {
|
|
|
303
307
|
|
|
304
308
|
let errorLogs = await getErrorLogs();
|
|
305
309
|
for await (let error of watchAllValues(errorLogs)) {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
let
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
suppressed
|
|
310
|
+
try {
|
|
311
|
+
let suppressionEntries = await getSuppressionEntries();
|
|
312
|
+
let suppressed = false;
|
|
313
|
+
let matchedSuppressionId: string | undefined = undefined;
|
|
314
|
+
|
|
315
|
+
for (let suppressionEntry of suppressionEntries) {
|
|
316
|
+
let status = applySuppression(error, suppressionEntry);
|
|
317
|
+
if (status === "suppressed" || status === "matched-timeout-passed") {
|
|
318
|
+
matchedSuppressionId = suppressionEntry.id;
|
|
319
|
+
void ErrorNotificationService.triggerSuppressionUpdate(suppressionEntry.id);
|
|
320
|
+
}
|
|
321
|
+
if (status === "suppressed") {
|
|
322
|
+
suppressed = true;
|
|
323
|
+
}
|
|
318
324
|
}
|
|
319
|
-
}
|
|
320
325
|
|
|
321
|
-
|
|
326
|
+
console.log(`Watch loop received error, ${suppressed ? "suppressed" : "not suppressed"}, matched suppression id: ${matchedSuppressionId}: ${error.param0}`);
|
|
322
327
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
328
|
+
if (suppressed && matchedSuppressionId) {
|
|
329
|
+
queueDiscordNotification(matchedSuppressionId, 1, false);
|
|
330
|
+
} else if (!suppressed) {
|
|
331
|
+
if (unmatchedErrors.length > unmatchedIndex) {
|
|
332
|
+
unmatchedErrors[unmatchedIndex] = error;
|
|
333
|
+
unmatchedIndex = (unmatchedIndex + 1) % MAX_UNMATCHED;
|
|
334
|
+
} else {
|
|
335
|
+
unmatchedErrors.push(error);
|
|
336
|
+
}
|
|
332
337
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
338
|
+
if (!matchedSuppressionId) {
|
|
339
|
+
const pattern = await generatePatternForError(error);
|
|
340
|
+
if (pattern) {
|
|
341
|
+
const newEntry: SuppressionEntry = {
|
|
342
|
+
id: nextId(),
|
|
343
|
+
pattern,
|
|
344
|
+
timeout: 0,
|
|
345
|
+
createdTime: Date.now(),
|
|
346
|
+
lastUpdatedTime: Date.now(),
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
suppressionCache.push(newEntry);
|
|
350
|
+
void suppression.set(newEntry.id, newEntry);
|
|
351
|
+
applySuppression(error, newEntry);
|
|
352
|
+
queueDiscordNotification(newEntry.id, 1, true);
|
|
353
|
+
|
|
354
|
+
void ErrorNotificationService.triggerSuppressionUpdate(newEntry.id);
|
|
355
|
+
}
|
|
350
356
|
}
|
|
351
|
-
}
|
|
352
357
|
|
|
353
|
-
|
|
358
|
+
void ErrorNotificationService.triggerUnmatchedError(error);
|
|
359
|
+
}
|
|
360
|
+
} catch (error) {
|
|
361
|
+
console.warn("Error in watch loop:", error);
|
|
354
362
|
}
|
|
355
363
|
}
|
|
356
364
|
}
|