Skip to content
Snippets Groups Projects
Commit 3cad06fc authored by Fabian Tërnava's avatar Fabian Tërnava
Browse files

fix old time names in ltm export

parent 1c89746c
No related branches found
No related tags found
2 merge requests!441Draft: Armem/ltm/dev,!346Armem/ltm/dev
......@@ -58,7 +58,8 @@ namespace armarx::armem::server::ltm
for (const auto& d : getAllDirectories()) // days
{
if (!util::fs::detail::isDateString(d.filename()))
if (!util::fs::detail::isDateString(d.filename()) and
!util::fs::detail::isNumberString(d.filename()))
{
ARMARX_WARNING << "Found a non-date folder inside an entity '" << id().str()
<< "' with name '" << d.filename() << "'. "
......@@ -477,46 +478,46 @@ namespace armarx::armem::server::ltm
void
Entity::_storeWithoutFiltering(const armem::wm::Entity& c)
{
std::lock_guard l(ltm_mutex);
if (id().entityName.empty())
{
ARMARX_WARNING
<< "During storage of segment '" << c.id().str()
<< "' I noticed that the corresponding LTM has no id set. "
<< "I set the id of the LTM to the same name, however this should not happen!";
id().entityName = c.id().entityName;
}
/*if (!connected())
std::lock_guard l(ltm_mutex);
if (id().entityName.empty())
{
ARMARX_WARNING
<< "During storage of segment '" << c.id().str()
<< "' I noticed that the corresponding LTM has no id set. "
<< "I set the id of the LTM to the same name, however this should not happen!";
id().entityName = c.id().entityName;
}
/*if (!connected())
{
ARMARX_WARNING << "LTM ENTITY NOT CONNECTED ALTHOUGH ENABLED " << id().str();
return;
}*/
//writeForeignKeyToPreviousDocument();
//writeForeignKeyToPreviousDocument();
c.forEachSnapshot(
[&](const auto& snap)
{
EntitySnapshot c(getMemoryBasePath(),
getSettings(),
getExportName(),
id().withTimestamp(snap.id().timestamp),
processors);
c.forEachSnapshot(
[&](const auto& snap)
{
EntitySnapshot c(getMemoryBasePath(),
getSettings(),
getExportName(),
id().withTimestamp(snap.id().timestamp),
processors);
// check if snapshot already exists
// check if snapshot already exists
if (hasSnapshot(snap.id().timestamp))
{
ARMARX_INFO << deactivateSpam()
<< "Ignoring to put an EntitiySnapshot into the LTM because "
"the timestamp already existed (we assume snapshots are "
"const and do not change outside the ltm).";
return;
}
if (hasSnapshot(snap.id().timestamp))
{
ARMARX_INFO << deactivateSpam()
<< "Ignoring to put an EntitiySnapshot into the LTM because "
"the timestamp already existed (we assume snapshots are "
"const and do not change outside the ltm).";
return;
}
c.store(snap);
statistics.recordedSnapshots++;
});
c.store(snap);
statistics.recordedSnapshots++;
});
}
} // namespace armarx::armem::server::ltm
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment