MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / event_flatstore_timer

Function event_flatstore_timer

modules/event_flatstore/event_flatstore.c:1022–1043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1020}
1021
1022static void event_flatstore_timer(unsigned int ticks, void *param)
1023{
1024 struct flat_file* file;
1025
1026 /* we only run when ticks is multiple of file_rotate_period */
1027 if (time(NULL) % file_rotate_period != 0)
1028 return;
1029
1030 lock_get(global_lock);
1031 for (file = *list_files; file; file = file->next) {
1032 file->rotate_version++;
1033 file->record_count = 0;
1034 file->bytes_written = 0;
1035 ensure_file_path(file, 1);
1036 raise_rotation_event(file, ROTATE_REASON_PERIOD);
1037 LM_DBG("File %s is being rotated at %u - new file is %s\n",
1038 file->path.s, ticks, file->pathname);
1039 }
1040 /* inform everyone they need to rotate */
1041 lock_release(global_lock);
1042 ipc_send_rpc_all(event_flatstore_rotate, 0);
1043}
1044
1045static void verify_delete(void) {
1046 struct flat_delete *del_it, *del_prev, *del_tmp;

Callers

nothing calls this directly

Calls 5

lock_getFunction · 0.85
ensure_file_pathFunction · 0.85
raise_rotation_eventFunction · 0.85
lock_releaseFunction · 0.85
ipc_send_rpc_allFunction · 0.85

Tested by

no test coverage detected