mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-03-17 21:31:43 +01:00
import username search
This commit is contained in:
parent
21c9400c94
commit
5e21375a1b
@ -3,6 +3,7 @@ import { createRoot } from "react-dom/client";
|
||||
import { App } from "./app";
|
||||
import { GlobalProviders } from "./providers/global";
|
||||
import "./services/user-event-sync";
|
||||
import "./services/username-search";
|
||||
|
||||
// setup bitcoin connect
|
||||
import { init, onConnected } from "@getalby/bitcoin-connect-react";
|
||||
|
@ -3,13 +3,16 @@ import { getSearchNames } from "../helpers/nostr/user-metadata";
|
||||
import db from "./db";
|
||||
import replaceableEventsService from "./replaceable-events";
|
||||
import userMetadataService from "./user-metadata";
|
||||
import { logger } from "../helpers/debug";
|
||||
|
||||
const WRITE_USER_SEARCH_BATCH_TIME = 500;
|
||||
const log = logger.extend("UsernameSearch");
|
||||
|
||||
const writeSearchQueue = new Set<string>();
|
||||
const writeSearchData = _throttle(async () => {
|
||||
if (writeSearchQueue.size === 0) return;
|
||||
|
||||
log(`Writing ${writeSearchQueue.size} to search table`);
|
||||
const keys = Array.from(writeSearchQueue);
|
||||
writeSearchQueue.clear();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user