MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / logdelete_thread

Function logdelete_thread

bdb/threads.c:320–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318}
319
320void *logdelete_thread(void *arg)
321{
322 bdb_state_type *bdb_state = (bdb_state_type *)arg;
323 if (bdb_state->parent) bdb_state = bdb_state->parent;
324
325 while (!bdb_state->after_llmeta_init_done)
326 sleep(1);
327
328 thrman_register(THRTYPE_GENERIC);
329 thread_started("bdb logdelete");
330
331 bdb_thread_event(bdb_state, 1);
332 time_t last_run_time = 0;
333
334 while (!db_is_exiting()) {
335 time_t now = time(NULL);
336 int run_interval = bdb_state->attr->logdelete_run_interval;
337 run_interval = (run_interval <= 0 ? 30 : run_interval);
338
339 if ((now - last_run_time) >= run_interval) {
340 delete_log_files(bdb_state);
341 last_run_time = now;
342 }
343 sleep(1);
344 }
345
346 logmsg(LOGMSG_DEBUG, "logdelete_thread: exiting\n");
347 bdb_thread_event(bdb_state, 0);
348 return NULL;
349}
350
351extern int gbl_rowlocks;
352extern unsigned long long osql_log_time(void);

Callers

nothing calls this directly

Calls 6

thrman_registerFunction · 0.85
thread_startedFunction · 0.85
bdb_thread_eventFunction · 0.85
db_is_exitingFunction · 0.85
delete_log_filesFunction · 0.85
logmsgFunction · 0.50

Tested by

no test coverage detected