feat(crawler): fix async crawling
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { drizzle } from "drizzle-orm/node-postgres";
|
||||
import { Pool } from "pg";
|
||||
|
||||
import * as schema from "@/schema";
|
||||
|
||||
const isDevelopment = process.env.NODE_ENV === "development";
|
||||
@@ -21,7 +22,7 @@ const pool = new Pool({
|
||||
export const getConnectionPoolStats = () => {
|
||||
const stats = {
|
||||
active: Math.max(0, (pool.totalCount ?? 0) - (pool.idleCount ?? 0)),
|
||||
ended: (pool as any).ended ?? false,
|
||||
ended: pool.ended ?? false,
|
||||
idle: pool.idleCount ?? 0,
|
||||
name: "primary",
|
||||
total: pool.options.max ?? 0,
|
||||
|
||||
@@ -4,13 +4,13 @@ import { and, asc, desc, eq, gt, lt, or, sql } from "drizzle-orm";
|
||||
import type { Database } from "@/client";
|
||||
import { articles, bookmarkArticles, bookmarks, comments, sources, users } from "@/schema";
|
||||
import {
|
||||
buildPaginationResult,
|
||||
createPageState,
|
||||
decodeCursor,
|
||||
type PageRequest,
|
||||
type PageState,
|
||||
type PaginationMeta,
|
||||
type SortDirection,
|
||||
buildPaginationResult,
|
||||
createPageState,
|
||||
decodeCursor,
|
||||
} from "@/utils/pagination";
|
||||
|
||||
export interface ArticleFilters {
|
||||
|
||||
@@ -4,11 +4,11 @@ import { and, desc, eq, lt, sql } from "drizzle-orm";
|
||||
import type { Database } from "@/client";
|
||||
import { bookmarkArticles, bookmarks } from "@/schema";
|
||||
import {
|
||||
type PageRequest,
|
||||
type PaginationMeta,
|
||||
buildPaginationResult,
|
||||
createPageState,
|
||||
decodeCursor,
|
||||
type PageRequest,
|
||||
type PaginationMeta,
|
||||
} from "@/utils/pagination";
|
||||
|
||||
export interface BookmarkRow {
|
||||
|
||||
@@ -5,11 +5,11 @@ import type { Database } from "@/client";
|
||||
import { PUBLICATION_GRAPH_DAYS, SOURCE_IMAGE_BASE } from "@/constant";
|
||||
import { articles, followedSources, sources } from "@/schema";
|
||||
import {
|
||||
type PageRequest,
|
||||
type PaginationMeta,
|
||||
buildPaginationResult,
|
||||
createPageState,
|
||||
decodeCursor,
|
||||
type PageRequest,
|
||||
type PaginationMeta,
|
||||
} from "@/utils/pagination";
|
||||
|
||||
export interface SourceOverviewRow {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { sql } from "drizzle-orm";
|
||||
|
||||
import { db } from "@/client";
|
||||
|
||||
export async function checkHealth() {
|
||||
|
||||
@@ -7,14 +7,15 @@
|
||||
"incremental": false,
|
||||
"isolatedModules": true,
|
||||
"lib": ["es2022", "DOM", "DOM.Iterable"],
|
||||
"module": "NodeNext",
|
||||
"module": "ESNext",
|
||||
"moduleDetection": "force",
|
||||
"moduleResolution": "NodeNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"target": "ES2022"
|
||||
"target": "ES2022",
|
||||
"verbatimModuleSyntax": false
|
||||
},
|
||||
"display": "Default"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { cn } from "@basango/ui/lib/utils";
|
||||
import { Slot } from "@radix-ui/react-slot";
|
||||
import { cva, type VariantProps } from "class-variance-authority";
|
||||
import { type VariantProps, cva } from "class-variance-authority";
|
||||
import * as React from "react";
|
||||
|
||||
const buttonVariants = cva(
|
||||
|
||||
Reference in New Issue
Block a user