change function sf_add_slow_log_schedule prototype

connection_manager
YuQing 2020-12-30 16:23:39 +08:00
parent a05e343e9b
commit 0012c2de92
2 changed files with 6 additions and 7 deletions

View File

@ -615,25 +615,25 @@ int sf_startup_schedule(pthread_t *schedule_tid)
&g_sf_global_vars.continue_flag);
}
int sf_add_slow_log_schedule(LogContext *pContext,
SFSlowLogConfig *slow_log_cfg)
int sf_add_slow_log_schedule(SFSlowLogContext *slowlog_ctx)
{
int result;
ScheduleArray scheduleArray;
ScheduleEntry scheduleEntries[LOG_SCHEDULE_ENTRIES_COUNT];
if (!slow_log_cfg->enabled) {
if (!slowlog_ctx->cfg.enabled) {
return 0;
}
if ((result=sf_logger_init(pContext, slow_log_cfg->
if ((result=sf_logger_init(&slowlog_ctx->ctx, slowlog_ctx->cfg.
filename_prefix)) != 0)
{
return result;
}
scheduleArray.entries = scheduleEntries;
sf_setup_schedule(pContext, &slow_log_cfg->log_cfg, &scheduleArray);
sf_setup_schedule(&slowlog_ctx->ctx, &slowlog_ctx->cfg.log_cfg,
&scheduleArray);
return sched_add_entries(&scheduleArray);
}

View File

@ -69,8 +69,7 @@ int sf_service_destroy_ex(SFContext *sf_context);
int sf_setup_signal_handler();
int sf_startup_schedule(pthread_t *schedule_tid);
int sf_add_slow_log_schedule(LogContext *pContext,
SFSlowLogConfig *slow_log_cfg);
int sf_add_slow_log_schedule(SFSlowLogContext *slowlog_ctx);
void sf_set_current_time();