cleanup code is incomplete
bstarynk opened this issue · 0 comments
bstarynk commented
In commit 8ec3726 we do have some
--cleanup
program option. That program flag is supposed to be run by ./helpcovid
launched from some crontab(5) job running e.g. every five or ten minutes. It runs the hcv_background_periodic_cleanup
C++ function in C++ file hcv_background.cc
which should also be run periodically.
That hcv_background_periodic_cleanup
C++ function is incomplete, and should cleanup both the database and any global data structure (protected by some std::mutex
or std::recursive_mutex
).
We may need to use also some std::condition_variable
and/or synchronize threads using hcv_bg_event_fd
so eventfd(2).
We might also synchronize threads using pipe(7) or temporary fifo(7).