Browse Source

fix long sites

main
matthew 2 years ago
parent
commit
cf8988ac63
  1. 1
      searching-front/app/core/components/WebsiteCard/styles.module.css
  2. 4
      searching-front/services/parser.ts

1
searching-front/app/core/components/WebsiteCard/styles.module.css

@ -27,6 +27,7 @@
max-width: 300px; max-width: 300px;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis;
} }
.description { .description {

4
searching-front/services/parser.ts

@ -12,7 +12,7 @@ const findFirstNotIndexed = (subpages: SubPages = {}) => {
const indexWebsite = async (domain: string, path: string, subpages: SubPages = {}) => { const indexWebsite = async (domain: string, path: string, subpages: SubPages = {}) => {
const subpagesLength = Object.keys(subpages).length; const subpagesLength = Object.keys(subpages).length;
if (!subpages[path] && subpagesLength < 100) { if (!subpages[path] && subpagesLength < 50) {
const url = domain + path; const url = domain + path;
const parseInfo = await Parser.parseUrl(url) const parseInfo = await Parser.parseUrl(url)
subpages[path] = true subpages[path] = true
@ -41,12 +41,10 @@ const indexWebsite = async (domain: string, path: string, subpages: SubPages = {
const main = async () => { const main = async () => {
await Elastic.initElastic() await Elastic.initElastic()
console.log('Success InitElastic')
const domains = await db.nftDomain.findMany() const domains = await db.nftDomain.findMany()
console.log('Find domains', domains) console.log('Find domains', domains)
if (domains) { if (domains) {
for (const domain of domains) { for (const domain of domains) {
console.log('Update ', domain)
await db.nftDomain.update({ await db.nftDomain.update({
where: { address: domain.address }, where: { address: domain.address },
data: { lastParse: new Date() }, data: { lastParse: new Date() },

Loading…
Cancel
Save