@webeyez/mcp-server 1.0.5 → 1.0.6
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/tools/job-store.js +11 -0
- package/dist/tools/public.js +0 -3
- package/package.json +1 -1
package/dist/tools/job-store.js
CHANGED
|
@@ -7,6 +7,17 @@ exports.InMemoryJobStore = void 0;
|
|
|
7
7
|
*/
|
|
8
8
|
class InMemoryJobStore {
|
|
9
9
|
activeJobs = new Map();
|
|
10
|
+
constructor() {
|
|
11
|
+
// Run cleanup interval every 1 minute to prune jobs older than 10 minutes
|
|
12
|
+
setInterval(() => {
|
|
13
|
+
const tenMinutesAgo = Date.now() - 10 * 60 * 1000;
|
|
14
|
+
for (const [jobId, job] of this.activeJobs.entries()) {
|
|
15
|
+
if (job.startedAt < tenMinutesAgo) {
|
|
16
|
+
this.activeJobs.delete(jobId);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}, 60 * 1000);
|
|
20
|
+
}
|
|
10
21
|
async get(jobId) {
|
|
11
22
|
return this.activeJobs.get(jobId);
|
|
12
23
|
}
|
package/dist/tools/public.js
CHANGED
|
@@ -354,8 +354,6 @@ function setupPublicTools(server, context) {
|
|
|
354
354
|
};
|
|
355
355
|
}
|
|
356
356
|
if (job.status === 'error') {
|
|
357
|
-
// Once retrieved, we can optionally clean up the job to free memory
|
|
358
|
-
await jobStore.delete(jobId);
|
|
359
357
|
return {
|
|
360
358
|
content: [{
|
|
361
359
|
type: "text",
|
|
@@ -376,7 +374,6 @@ function setupPublicTools(server, context) {
|
|
|
376
374
|
resultData = resultData.substring(0, debugIndex).trim();
|
|
377
375
|
}
|
|
378
376
|
}
|
|
379
|
-
await jobStore.delete(jobId);
|
|
380
377
|
return {
|
|
381
378
|
content: [{
|
|
382
379
|
type: "text",
|