Admin health report (Plex, mail accounts, disk, last backup)

This commit is contained in:
nmemmert committed 2026-10-23 09:33:33 -04:00
1 parent 2c8afdef79
commit 1981e66b8a
4 files changed
+30 -3

No files matched your search

+5 -1
View File
@@ -335,4 +335,8 @@ async function newest() {
for (const a of accounts()) { try { const r = await withTimeout(providerOf(a).list(a, { folder: 'inbox', skip: 0, q: '' }), 15000); for (const m of r.items.slice(0, 10)) out.push({ id: a.id + ':' + m.id, subject: m.subject, from: (m.from && (m.from.name || m.from.address)) || '', read: !!m.read }); } catch { /* skipped this round */ } }
return out;
}
module.exports = { newest, enabled, outlookOn, handle, callback, secretStatus, recipients, textToHtml };
/** For the admin health page: can each connected account be reached right now? */
async function health() {
return Promise.all(accounts().map(async a => { const t = Date.now(); try { await withTimeout(providerOf(a).unread(a), 8000); return { address: a.address, type: a.type, ok: true, ms: Date.now() - t }; } catch (e) { return { address: a.address, type: a.type, ok: false, error: e.message }; } }));
}
module.exports = { health, newest, enabled, outlookOn, handle, callback, secretStatus, recipients, textToHtml };