Added more logging to cleaner.
This commit is contained in:
parent
2eb5d3c3ff
commit
7f4206e25c
@ -18,11 +18,15 @@ Cleaning::Cleaning(ConcurrentMap<std::string, Db> &dbs) : dbms(dbs)
|
|||||||
std::time_t now = std::time(nullptr);
|
std::time_t now = std::time(nullptr);
|
||||||
|
|
||||||
if (now >= last_clean + cleaning_cycle) {
|
if (now >= last_clean + cleaning_cycle) {
|
||||||
|
logger.info("Started cleaning cyle");
|
||||||
for (auto &db : dbs.access()) {
|
for (auto &db : dbs.access()) {
|
||||||
|
logger.info("Cleaning database \"{}\"", db.first);
|
||||||
DbTransaction t(db.second);
|
DbTransaction t(db.second);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
logger.info("Cleaning edges");
|
||||||
t.clean_edge_section();
|
t.clean_edge_section();
|
||||||
|
logger.info("Cleaning vertices");
|
||||||
t.clean_vertex_section();
|
t.clean_vertex_section();
|
||||||
} catch (const std::exception &e) {
|
} catch (const std::exception &e) {
|
||||||
logger.error(
|
logger.error(
|
||||||
@ -34,6 +38,7 @@ Cleaning::Cleaning(ConcurrentMap<std::string, Db> &dbs) : dbms(dbs)
|
|||||||
t.trans.commit();
|
t.trans.commit();
|
||||||
}
|
}
|
||||||
last_clean = now;
|
last_clean = now;
|
||||||
|
logger.info("Finished cleaning cyle");
|
||||||
} else {
|
} else {
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user