mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-19 14:34:22 +01:00
Pass Request signal down from API controllers
This commit is contained in:
@@ -6,10 +6,11 @@ import { renderNotification } from '@/views/mastodon/notifications.ts';
|
||||
const notificationsController: AppController = async (c) => {
|
||||
const pubkey = c.get('pubkey')!;
|
||||
const { since, until } = paginationSchema.parse(c.req.query());
|
||||
const { signal } = c.req.raw;
|
||||
|
||||
const events = await eventsDB.query(
|
||||
[{ kinds: [1], '#p': [pubkey], since, until }],
|
||||
{ signal: AbortSignal.timeout(3000) },
|
||||
{ signal },
|
||||
);
|
||||
|
||||
const statuses = await Promise.all(events.map((event) => renderNotification(event, pubkey)));
|
||||
|
||||
Reference in New Issue
Block a user