Admin health report (Plex, mail accounts, disk, last backup)
This commit is contained in:
1 parent
2c8afdef79
commit
1981e66b8a
4 files changed
+30
-3
No files matched your search
@@ -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 };
|
||||
Reference in new issue
Block a user