From b74e1a0bab6fbc1b0d6cb40b24439e14300d897b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 3 Jan 2016 21:37:35 +0000 Subject: Switch to explicit caching base class --- gentoobrowse-api/service/portageimpl.cpp | 36 ++++++++++++++++---------------- gentoobrowse-api/service/portageimpl.h | 4 ++-- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/gentoobrowse-api/service/portageimpl.cpp b/gentoobrowse-api/service/portageimpl.cpp index 99af5f8..af446d9 100644 --- a/gentoobrowse-api/service/portageimpl.cpp +++ b/gentoobrowse-api/service/portageimpl.cpp @@ -20,110 +20,110 @@ namespace Gentoo { namespace Service { Portage::Portage(boost::shared_ptr> d) : - IceTray::AbstractDatabaseClient(d) + IceTray::AbstractCachingDatabaseClient(d) { } Gentoo::CategoryPtr Portage::getCategory(Ice::Int id, const Ice::Current &) { - return fetch(id); + return fetchCache(30, id); } Gentoo::Categories Portage::getAllCategories(const Ice::Current &) { - return fetch(); + return fetchCache(30); } Gentoo::Categories Portage::getCategoriesInSuper(const std::string & super, const Ice::Current &) { - return fetch(super); + return fetchCache(30, super); } Gentoo::OverviewCategories Portage::getOverviewCategoriesInSuper(const std::string & super, const Ice::Current &) { - return fetch(super); + return fetchCache(30, super); } Gentoo::PackagePtr Portage::getPackage(Ice::Int id, const Ice::Current &) { - return fetch(id); + return fetchCache(30, id); } IceUtil::Optional Portage::findPackage(const std::string & cat, const std::string & pkg, const Ice::Current &) { - return fetch, sql::portage::findPackage>(cat, pkg); + return fetchCache, sql::portage::findPackage>(30, cat, pkg); } Gentoo::Packages Portage::getPackagesInCategory(Ice::Int id, const Ice::Current &) { - return fetch(id); + return fetchCache(30, id); } Gentoo::SearchResultPackages Portage::getPackagesSearch(const std::string & query, const Ice::Current &) { - return fetch(query, query); + return fetchCache(30, query, query); } Gentoo::Ebuilds Portage::getPackageVersions(Ice::Int id, const Ice::Current &) { - return fetch(id); + return fetchCache(30, id); } Gentoo::ChangeLog Portage::getPackageChangeLog(Ice::Int id, const Ice::Current &) { - return fetch(id); + return fetchCache(30, id); } Gentoo::Ebuilds Portage::getRecentAdditions(Ice::Int syncs, const Ice::Current &) { - return fetch(syncs); + return fetchCache(30, syncs); } Gentoo::BugPtr Portage::getBug(Ice::Int id, const Ice::Current &) { - return fetch(id); + return fetchCache(30, id); } Gentoo::Bugs Portage::getPackageBugs(Ice::Int packageId, const Ice::Current &) { - return fetch(packageId); + return fetchCache(30, packageId); } Gentoo::SearchResultBugs Portage::getBugsSearch(const std::string & query, const Ice::Current &) { - return fetch(query, query); + return fetchCache(30, query, query); } Gentoo::NewsItemPtr Portage::getNewsItem(const std::string & id, const Ice::Current &) { - return fetch(id); + return fetchCache(30, id); } Gentoo::News Portage::getNewsSearch(const std::string & query, const Ice::Current &) { - return fetch(query); + return fetchCache(30, query); } Gentoo::News Portage::getNewsRecent(Ice::Int items, const Ice::Current &) { - return fetch(items); + return fetchCache(30, items); } } } diff --git a/gentoobrowse-api/service/portageimpl.h b/gentoobrowse-api/service/portageimpl.h index 980aeb3..d47941b 100644 --- a/gentoobrowse-api/service/portageimpl.h +++ b/gentoobrowse-api/service/portageimpl.h @@ -3,11 +3,11 @@ #include #include -#include +#include namespace Gentoo { namespace Service { -class DLL_PUBLIC Portage : public Gentoo::Portage, IceTray::AbstractDatabaseClient { +class DLL_PUBLIC Portage : public Gentoo::Portage, IceTray::AbstractCachingDatabaseClient { public: Portage(boost::shared_ptr> d); -- cgit v1.2.3