reqmeister: middleware/cache, reqmeister, nip05, unfurl, refactor some code

This commit is contained in:
Alex Gleason
2023-12-27 20:07:13 -06:00
parent e121a8805e
commit 2fc9988c06
10 changed files with 39 additions and 30 deletions

View File

@@ -1,7 +1,9 @@
import { TTLCache, unfurl } from '@/deps.ts';
import { Debug, TTLCache, unfurl } from '@/deps.ts';
import { Time } from '@/utils/time.ts';
import { fetchWorker } from '@/workers/fetch.ts';
const debug = Debug('ditto:unfurl');
interface PreviewCard {
url: string;
title: string;
@@ -20,7 +22,7 @@ interface PreviewCard {
}
async function unfurlCard(url: string, signal: AbortSignal): Promise<PreviewCard | null> {
console.log(`Unfurling ${url}...`);
debug(`Unfurling ${url}...`);
try {
const result = await unfurl(url, {
fetch: (url) => fetchWorker(url, { signal }),