From 1d28c06272c680470ff0566f9a08887cef625f17 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 13 Mar 2017 14:53:53 +0000 Subject: Remove getSyncs method as it nolonger makes much sense --- gentoobrowse-api/api/portage.ice | 1 - gentoobrowse-api/domain/portage-models.ice | 8 -------- gentoobrowse-api/service/portageimpl.cpp | 7 ------- gentoobrowse-api/service/portageimpl.h | 1 - gentoobrowse-api/service/sql/portage/getSyncs.sql | 6 ------ gentoobrowse-api/unittests/testPortage.cpp | 10 ---------- 6 files changed, 33 deletions(-) delete mode 100644 gentoobrowse-api/service/sql/portage/getSyncs.sql diff --git a/gentoobrowse-api/api/portage.ice b/gentoobrowse-api/api/portage.ice index fe159ad..87acd45 100644 --- a/gentoobrowse-api/api/portage.ice +++ b/gentoobrowse-api/api/portage.ice @@ -19,7 +19,6 @@ module Gentoo { idempotent Ebuilds getPackageVersions(int id); idempotent EbuildDetails getPackageVersionDetails(int id); idempotent ChangeLog getPackageChangeLog(int id); - idempotent Syncs getSyncs(int syncs); idempotent Ebuilds getRecentAdditions(int syncs); idempotent Packages getPackagesWithRecentAdditions(int syncs); idempotent Categories getCategoriesWithRecentAdditions(int syncs); diff --git a/gentoobrowse-api/domain/portage-models.ice b/gentoobrowse-api/domain/portage-models.ice index 71930b0..32bda7c 100644 --- a/gentoobrowse-api/domain/portage-models.ice +++ b/gentoobrowse-api/domain/portage-models.ice @@ -101,12 +101,6 @@ module Gentoo { StringList atomspec; }; - struct Sync { - [ "slicer:conversion:boost.posix_time.ptime:boost.posix_time.to_iso_extended_string:boost.posix_time.time_from_string:nodeclare" ] - string timestamp; - int ebuilds; - }; - struct Repository { ["slicer:db:pkey"] int repoid; @@ -134,8 +128,6 @@ module Gentoo { sequence ChangeLog; [ "slicer:element:article" ] sequence News; - [ "slicer:element:sync" ] - sequence Syncs; [ "slicer:element:mask" ] sequence Masks; [ "slicer:element:repo" ] diff --git a/gentoobrowse-api/service/portageimpl.cpp b/gentoobrowse-api/service/portageimpl.cpp index 7677ceb..b05dab7 100644 --- a/gentoobrowse-api/service/portageimpl.cpp +++ b/gentoobrowse-api/service/portageimpl.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -139,12 +138,6 @@ Portage::getPackageChangeLog(Ice::Int id, const Ice::Current &) return fetchCache(sql::portage::getPackageChangeLog, 30, id); } -Gentoo::Syncs -Portage::getSyncs(Ice::Int syncs, const Ice::Current &) -{ - return fetchCache(sql::portage::getSyncs, 30, syncs); -} - Gentoo::Ebuilds Portage::getRecentAdditions(Ice::Int syncs, const Ice::Current &) { diff --git a/gentoobrowse-api/service/portageimpl.h b/gentoobrowse-api/service/portageimpl.h index be8742a..36e4e5a 100644 --- a/gentoobrowse-api/service/portageimpl.h +++ b/gentoobrowse-api/service/portageimpl.h @@ -26,7 +26,6 @@ class DLL_PUBLIC Portage : public Gentoo::Portage, IceTray::AbstractCachingDatab Gentoo::Ebuilds getPackageVersions(Ice::Int id, const Ice::Current &) override; Gentoo::EbuildDetails getPackageVersionDetails(Ice::Int id, const Ice::Current &) override; Gentoo::ChangeLog getPackageChangeLog(Ice::Int id, const Ice::Current &) override; - Gentoo::Syncs getSyncs(Ice::Int syncs, const Ice::Current &) override; Gentoo::Ebuilds getRecentAdditions(Ice::Int syncs, const Ice::Current &) override; Gentoo::Packages getPackagesWithRecentAdditions(Ice::Int syncs, const Ice::Current &) override; Gentoo::Categories getCategoriesWithRecentAdditions(Ice::Int syncs, const Ice::Current &) override; diff --git a/gentoobrowse-api/service/sql/portage/getSyncs.sql b/gentoobrowse-api/service/sql/portage/getSyncs.sql deleted file mode 100644 index dea88ac..0000000 --- a/gentoobrowse-api/service/sql/portage/getSyncs.sql +++ /dev/null @@ -1,6 +0,0 @@ --- libdbpp:no-cursor -SELECT s.firstseen AS timestamp, COUNT(*) AS ebuilds -FROM gentoobrowse.ebuilds s -GROUP BY s.firstseen -ORDER BY s.firstseen DESC -LIMIT ? diff --git a/gentoobrowse-api/unittests/testPortage.cpp b/gentoobrowse-api/unittests/testPortage.cpp index aa10ee9..e4ff9ff 100644 --- a/gentoobrowse-api/unittests/testPortage.cpp +++ b/gentoobrowse-api/unittests/testPortage.cpp @@ -59,16 +59,6 @@ BOOST_AUTO_TEST_CASE( getCategoriesInSuper ) BOOST_REQUIRE_EQUAL(0, cats.size()); } -BOOST_AUTO_TEST_CASE( getSyncs ) -{ - auto syncs = p->getSyncs(3); - BOOST_REQUIRE_EQUAL(3, syncs.size()); - BOOST_REQUIRE_EQUAL("2015-12-07T15:01:06.742996", syncs.front().timestamp); - BOOST_REQUIRE_EQUAL(3, syncs.front().ebuilds); - BOOST_REQUIRE_EQUAL("2015-11-29T15:00:49.856355", syncs.back().timestamp); - BOOST_REQUIRE_EQUAL(3, syncs.back().ebuilds); -} - BOOST_AUTO_TEST_CASE( getCategoriesWithRecentAdditions ) { auto cats = p->getCategoriesWithRecentAdditions(3); -- cgit v1.2.3