1
This commit is contained in:
@@ -58,7 +58,9 @@ export function get_app_config() {
|
||||
chrome_executable_path: (get_env('CHROME_EXECUTABLE_PATH') || '').trim() || path.resolve(__dirname, '../../chrome-win/chrome.exe'),
|
||||
log_invoke_action: get_bool('LOG_INVOKE_ACTION', true),
|
||||
auto_close_browser: get_bool('AUTO_CLOSE_BROWSER', true),
|
||||
enable_stealth: get_bool('ENABLE_STEALTH', true)
|
||||
enable_stealth: get_bool('ENABLE_STEALTH', true),
|
||||
log_sql: get_bool('LOG_SQL', false),
|
||||
log_sql_benchmark: get_bool('LOG_SQL_BENCHMARK', false)
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user