kopia lustrzana https://gitlab.com/tomaszg/geostat
Okapi function to update list of caches with full data.
Maybe SQL request to db should be made slimmer by using this function.sql-rework
rodzic
c7d0ae948a
commit
9215f6ace9
|
@ -242,6 +242,13 @@ Caches Okapi::get_user_caches(const std::string& uuid, int count) const {
|
|||
return cc;
|
||||
}
|
||||
|
||||
void Okapi::update_caches(Caches& cc) const {
|
||||
std::set<std::string> codes;
|
||||
for (auto& i : cc)
|
||||
codes.insert(i.code);
|
||||
cc = get_caches(codes);
|
||||
}
|
||||
|
||||
std::string Okapi::get_uuid(const std::string& username) const {
|
||||
std::string service = url + OKAPI_username;
|
||||
std::string query = "consumer_key=" + key + "&username=" + username + "&fields=uuid";
|
||||
|
|
1
okapi.h
1
okapi.h
|
@ -30,6 +30,7 @@ public:
|
|||
Caches get_user_caches(const std::string& uuid, int count = 0) const override;
|
||||
std::string get_changelog_json(int revision) const;
|
||||
|
||||
void update_caches(Caches& cc) const;
|
||||
std::string get_uuid(const std::string& username) const;
|
||||
std::string get_profile_url(const std::string& uuid) const;
|
||||
};
|
||||
|
|
Ładowanie…
Reference in New Issue