MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / springClean

Function springClean

src/tools/store.cpp:71–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71void springClean()
72{
73 osrm::util::Log() << "Releasing all locks";
74 osrm::util::Log() << "ATTENTION! BE CAREFUL!";
75 osrm::util::Log() << "----------------------";
76 osrm::util::Log() << "This tool may put osrm-routed into an undefined state!";
77 osrm::util::Log() << "Type 'Y' to acknowledge that you know what your are doing.";
78 osrm::util::Log() << "\n\nDo you want to purge all shared memory allocated "
79 << "by osrm-datastore? [type 'Y' to confirm]";
80
81 const auto letter = getchar();
82 if (letter != 'Y')
83 {
84 osrm::util::Log() << "aborted.";
85 }
86 else
87 {
88 for (auto key : util::irange<storage::SharedRegionRegister::RegionID>(
89 0, storage::SharedRegionRegister::MAX_SHM_KEYS))
90 {
91 deleteRegion(key);
92 }
93 removeLocks();
94 }
95}
96
97// generate boost::program_options object for the routing part
98bool generateDataStoreOptions(const int argc,

Callers 1

generateDataStoreOptionsFunction · 0.85

Calls 3

LogClass · 0.85
deleteRegionFunction · 0.85
removeLocksFunction · 0.85

Tested by

no test coverage detected