mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-05 15:38:34 +08:00
perf: use waitUntil for async address activity updates (#826)
- Change updateAddressUpdatedAt to non-blocking async execution - GET /api/mails, /api/settings, /user_api/settings no longer wait for DB update - Improves response time for GET requests - Also updates dependencies Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
d367bc92b2
commit
e4b6c82e92
@@ -27,7 +27,7 @@ api.get('/api/mails', async (c) => {
|
||||
return c.json({ "error": "No address" }, 400)
|
||||
}
|
||||
const { limit, offset } = c.req.query();
|
||||
if (Number.parseInt(offset) <= 0) await updateAddressUpdatedAt(c, address);
|
||||
if (Number.parseInt(offset) <= 0) updateAddressUpdatedAt(c, address);
|
||||
return await handleListQuery(c,
|
||||
`SELECT * FROM raw_mails where address = ?`,
|
||||
`SELECT count(*) as count FROM raw_mails where address = ?`,
|
||||
@@ -90,7 +90,7 @@ api.get('/api/settings', async (c) => {
|
||||
return c.text(msgs.InvalidAddressMsg, 400)
|
||||
}
|
||||
|
||||
await updateAddressUpdatedAt(c, address);
|
||||
updateAddressUpdatedAt(c, address);
|
||||
|
||||
const no_limit_roles = getSplitStringListValue(c.env.NO_LIMIT_SEND_ROLE);
|
||||
const is_no_limit_send_balance = user_role && no_limit_roles.includes(user_role);
|
||||
|
||||
Reference in New Issue
Block a user