This commit is contained in:
张成
2026-03-18 18:07:41 +08:00
parent 18aa083c91
commit aecb7944a8
8 changed files with 44 additions and 57 deletions

View File

@@ -10,7 +10,18 @@ export function get_sequelize_options() {
password: cfg.mysql.password,
database: cfg.mysql.database,
dialect: 'mysql',
logging: false,
benchmark: cfg.crawler.log_sql_benchmark === true,
logging: cfg.crawler.log_sql === true
? (sql, timing_ms) => {
if (cfg.crawler.log_sql_benchmark === true && typeof timing_ms === 'number') {
// eslint-disable-next-line no-console
console.log('[sql]', { timing_ms, sql });
return;
}
// eslint-disable-next-line no-console
console.log('[sql]', sql);
}
: false,
define: {
underscored: true,
timestamps: true,