mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
refactor: use Stickynotes instead of legacy Debug
This commit is contained in:
parent
c5bcf1d4a3
commit
e42c047362
1 changed files with 5 additions and 5 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import { LNURL, LNURLDetails } from '@nostrify/nostrify/ln';
|
import { LNURL, LNURLDetails } from '@nostrify/nostrify/ln';
|
||||||
import Debug from '@soapbox/stickynotes/debug';
|
import { Stickynotes } from '@soapbox/stickynotes';
|
||||||
|
|
||||||
import { cachedLnurlsSizeGauge } from '@/metrics.ts';
|
import { cachedLnurlsSizeGauge } from '@/metrics.ts';
|
||||||
import { SimpleLRU } from '@/utils/SimpleLRU.ts';
|
import { SimpleLRU } from '@/utils/SimpleLRU.ts';
|
||||||
|
|
@ -7,17 +7,17 @@ import { Time } from '@/utils/time.ts';
|
||||||
import { fetchWorker } from '@/workers/fetch.ts';
|
import { fetchWorker } from '@/workers/fetch.ts';
|
||||||
import { NostrEvent } from '@nostrify/nostrify';
|
import { NostrEvent } from '@nostrify/nostrify';
|
||||||
|
|
||||||
const debug = Debug('ditto:lnurl');
|
const console = new Stickynotes('ditto:lnurl');
|
||||||
|
|
||||||
const lnurlCache = new SimpleLRU<string, LNURLDetails>(
|
const lnurlCache = new SimpleLRU<string, LNURLDetails>(
|
||||||
async (lnurl, { signal }) => {
|
async (lnurl, { signal }) => {
|
||||||
debug(`Lookup ${lnurl}`);
|
console.debug(`Lookup ${lnurl}`);
|
||||||
try {
|
try {
|
||||||
const result = await LNURL.lookup(lnurl, { fetch: fetchWorker, signal });
|
const result = await LNURL.lookup(lnurl, { fetch: fetchWorker, signal });
|
||||||
debug(`Found: ${lnurl}`);
|
console.debug(`Found: ${lnurl}`);
|
||||||
return result;
|
return result;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debug(`Not found: ${lnurl}`);
|
console.debug(`Not found: ${lnurl}`);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue