kopia lustrzana https://gitlab.com/tomaszg/geostat
Move the code updating revision of SQLite database out of destructor to places where it can really change.
rodzic
5eaf9ec43e
commit
d2682e5860
4
ocdb.cpp
4
ocdb.cpp
|
@ -27,7 +27,6 @@ OCdb::OCdb(std::string db_file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
OCdb::~OCdb() {
|
OCdb::~OCdb() {
|
||||||
request("UPDATE revision SET revision = " + std::to_string(revision) + ';');
|
|
||||||
sqlite3_close(db);
|
sqlite3_close(db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,6 +62,7 @@ bool OCdb::init(std::string dump_path) {
|
||||||
for (auto& el : j["data_files"].items()) {
|
for (auto& el : j["data_files"].items()) {
|
||||||
init_part(dump_path + el.value().get<std::string>());
|
init_part(dump_path + el.value().get<std::string>());
|
||||||
}
|
}
|
||||||
|
request("UPDATE revision SET revision = " + std::to_string(revision) + ';');
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,6 +91,8 @@ bool OCdb::update(Okapi& oc) {
|
||||||
revision = j["revision"];
|
revision = j["revision"];
|
||||||
if (j["more"])
|
if (j["more"])
|
||||||
update(oc);
|
update(oc);
|
||||||
|
else
|
||||||
|
request("UPDATE revision SET revision = " + std::to_string(revision) + ';');
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue