* fix: chat module link

* fix: url fetch check

* fix: import file ui

* feat: app logs

* perf: iframe icon

* imgs cdn

* perf: click range and pg
This commit is contained in:
Archer
2023-08-24 21:08:49 +08:00
committed by GitHub
parent 2b50dac0e7
commit 9415e22de9
30 changed files with 506 additions and 63 deletions

View File

@@ -2,7 +2,7 @@ import { Pool } from 'pg';
import type { QueryResultRow } from 'pg';
import { PgTrainingTableName } from '@/constants/plugin';
export const connectPg = async () => {
export const connectPg = async (): Promise<Pool> => {
if (global.pgClient) {
return global.pgClient;
}
@@ -17,6 +17,7 @@ export const connectPg = async () => {
global.pgClient.on('error', (err) => {
console.log(err);
global.pgClient = null;
connectPg();
});
try {
@@ -25,7 +26,7 @@ export const connectPg = async () => {
return global.pgClient;
} catch (error) {
global.pgClient = null;
return Promise.reject(error);
return connectPg();
}
};