id to index
parent
3c06e33be8
commit
b27ecc4c1e
|
|
@ -472,29 +472,29 @@ int sf_startup_schedule(pthread_t *schedule_tid)
|
|||
|
||||
ScheduleArray scheduleArray;
|
||||
ScheduleEntry scheduleEntries[SCHEDULE_ENTRIES_COUNT];
|
||||
int id;
|
||||
int index;
|
||||
|
||||
scheduleArray.entries = scheduleEntries;
|
||||
scheduleArray.count = 0;
|
||||
|
||||
memset(scheduleEntries, 0, sizeof(scheduleEntries));
|
||||
|
||||
id = scheduleArray.count++;
|
||||
INIT_SCHEDULE_ENTRY(scheduleEntries[id], id, TIME_NONE, TIME_NONE, 0,
|
||||
index = scheduleArray.count++;
|
||||
INIT_SCHEDULE_ENTRY(scheduleEntries[index], index + 1, TIME_NONE, TIME_NONE, 0,
|
||||
g_sf_global_vars.sync_log_buff_interval, log_sync_func, &g_log_context);
|
||||
|
||||
if (g_sf_global_vars.rotate_error_log) {
|
||||
log_set_rotate_time_format(&g_log_context, "%Y%m%d");
|
||||
|
||||
id = scheduleArray.count++;
|
||||
INIT_SCHEDULE_ENTRY(scheduleEntries[id], id, 0, 0, 0,
|
||||
index = scheduleArray.count++;
|
||||
INIT_SCHEDULE_ENTRY(scheduleEntries[index], index + 1, 0, 0, 0,
|
||||
86400, log_notify_rotate, &g_log_context);
|
||||
|
||||
if (g_sf_global_vars.log_file_keep_days > 0) {
|
||||
log_set_keep_days(&g_log_context, g_sf_global_vars.log_file_keep_days);
|
||||
|
||||
id = scheduleArray.count++;
|
||||
INIT_SCHEDULE_ENTRY(scheduleEntries[id], id, 1, 0, 0,
|
||||
index = scheduleArray.count++;
|
||||
INIT_SCHEDULE_ENTRY(scheduleEntries[index], index + 1, 1, 0, 0,
|
||||
86400, log_delete_old_files, &g_log_context);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue