Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22424025
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
971 B
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/back/remove-error-logs.ts b/src/back/remove-error-logs.ts
index e731907..5427dce 100644
--- a/src/back/remove-error-logs.ts
+++ b/src/back/remove-error-logs.ts
@@ -1,26 +1,26 @@
import { CronJob } from "cron";
import type TheApp from "./app.js";
export async function removeErrorLogs(app: TheApp) {
const removeLogsEveryHour = () => {
void (async () => {
try {
const currentTime = new Date().getTime();
const { items } = await app.collections.logs
.suList()
.filter({ timestamp: { "<": currentTime - 1000 * 60 * 60 } })
.fetch();
await Promise.all(
items.map((item) =>
- item.remove(new app.Context()).catch((e) => console.error(e))
+ item.remove(new app.SuperContext()).catch((e) => console.error(e))
)
);
} catch (err) {
console.error("Error while removing logs:", err);
}
})();
};
new CronJob("* * * * *", removeLogsEveryHour, null, true, "Poland");
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Nov 28, 03:49 (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1222912
Default Alt Text
(971 B)
Attached To
Mode
rAPROXY Assetproxy
Attached
Detach File
Event Timeline