querysub 0.387.0 → 0.388.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,8 @@ 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
|
+
|
|
204
206
|
Respond with a JSON object with a "pattern" field containing the search string.`;
|
|
205
207
|
|
|
206
208
|
const response = await callOpenRouterJSON<PatternResponse>(openRouterAPIKey, prompt);
|
|
@@ -303,54 +305,58 @@ export async function exposeErrorWatchService() {
|
|
|
303
305
|
|
|
304
306
|
let errorLogs = await getErrorLogs();
|
|
305
307
|
for await (let error of watchAllValues(errorLogs)) {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
let
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
suppressed
|
|
308
|
+
try {
|
|
309
|
+
let suppressionEntries = await getSuppressionEntries();
|
|
310
|
+
let suppressed = false;
|
|
311
|
+
let matchedSuppressionId: string | undefined = undefined;
|
|
312
|
+
|
|
313
|
+
for (let suppressionEntry of suppressionEntries) {
|
|
314
|
+
let status = applySuppression(error, suppressionEntry);
|
|
315
|
+
if (status === "suppressed" || status === "matched-timeout-passed") {
|
|
316
|
+
matchedSuppressionId = suppressionEntry.id;
|
|
317
|
+
void ErrorNotificationService.triggerSuppressionUpdate(suppressionEntry.id);
|
|
318
|
+
}
|
|
319
|
+
if (status === "suppressed") {
|
|
320
|
+
suppressed = true;
|
|
321
|
+
}
|
|
318
322
|
}
|
|
319
|
-
}
|
|
320
323
|
|
|
321
|
-
|
|
324
|
+
console.log(`Watch loop received error, ${suppressed ? "suppressed" : "not suppressed"}, matched suppression id: ${matchedSuppressionId}: ${error.param0}`);
|
|
322
325
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
326
|
+
if (suppressed && matchedSuppressionId) {
|
|
327
|
+
queueDiscordNotification(matchedSuppressionId, 1, false);
|
|
328
|
+
} else if (!suppressed) {
|
|
329
|
+
if (unmatchedErrors.length > unmatchedIndex) {
|
|
330
|
+
unmatchedErrors[unmatchedIndex] = error;
|
|
331
|
+
unmatchedIndex = (unmatchedIndex + 1) % MAX_UNMATCHED;
|
|
332
|
+
} else {
|
|
333
|
+
unmatchedErrors.push(error);
|
|
334
|
+
}
|
|
332
335
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
336
|
+
if (!matchedSuppressionId) {
|
|
337
|
+
const pattern = await generatePatternForError(error);
|
|
338
|
+
if (pattern) {
|
|
339
|
+
const newEntry: SuppressionEntry = {
|
|
340
|
+
id: nextId(),
|
|
341
|
+
pattern,
|
|
342
|
+
timeout: 0,
|
|
343
|
+
createdTime: Date.now(),
|
|
344
|
+
lastUpdatedTime: Date.now(),
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
suppressionCache.push(newEntry);
|
|
348
|
+
void suppression.set(newEntry.id, newEntry);
|
|
349
|
+
applySuppression(error, newEntry);
|
|
350
|
+
queueDiscordNotification(newEntry.id, 1, true);
|
|
351
|
+
|
|
352
|
+
void ErrorNotificationService.triggerSuppressionUpdate(newEntry.id);
|
|
353
|
+
}
|
|
350
354
|
}
|
|
351
|
-
}
|
|
352
355
|
|
|
353
|
-
|
|
356
|
+
void ErrorNotificationService.triggerUnmatchedError(error);
|
|
357
|
+
}
|
|
358
|
+
} catch (error) {
|
|
359
|
+
console.warn("Error in watch loop:", error);
|
|
354
360
|
}
|
|
355
361
|
}
|
|
356
362
|
}
|