Commit cebfda46 by taven Committed by GitHub

feat: update OceanBase vector DB controller log format (#6331)

parent 3454f21b
...@@ -31,16 +31,16 @@ export const getClient = async (): Promise<Pool> => { ...@@ -31,16 +31,16 @@ export const getClient = async (): Promise<Pool> => {
try { try {
// Test the connection with a simple query instead of calling connect() // Test the connection with a simple query instead of calling connect()
await global.obClient.query('SELECT 1'); await global.obClient.query('SELECT 1');
addLog.info(`oceanbase connected`); addLog.info(`[OceanBase] connect`);
return global.obClient; return global.obClient;
} catch (error) { } catch (error) {
addLog.error(`oceanbase connect error`, error); addLog.error(`[OceanBase] connect error`, error);
global.obClient?.end(); global.obClient?.end();
global.obClient = null; global.obClient = null;
await delay(1000); await delay(1000);
addLog.info(`Retry connect oceanbase`); addLog.info(`[OceanBase] retry connect`);
return getClient(); return getClient();
} }
...@@ -216,7 +216,7 @@ class ObClass { ...@@ -216,7 +216,7 @@ class ObClass {
insertIds: [] insertIds: []
}; };
} catch (error) { } catch (error) {
addLog.error(`OceanBase batch insert error: ${error}`); addLog.error('[OceanBase] batch insert error', error);
throw error; throw error;
} finally { } finally {
connection.release(); // 释放连接回连接池 connection.release(); // 释放连接回连接池
...@@ -229,7 +229,7 @@ class ObClass { ...@@ -229,7 +229,7 @@ class ObClass {
const time = Date.now() - start; const time = Date.now() - start;
if (time > 300) { if (time > 300) {
addLog.warn(`oceanbase query time: ${time}ms, sql: ${sql}`); addLog.warn(`[OceanBase] query time: ${time}ms, sql: ${sql}`);
} }
return res; return res;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment