summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2017-05-17 19:58:46 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2017-05-17 19:58:46 +0100
commit283197a60fbdb0a594b2fe05b8faf6aa0e8abd00 (patch)
tree161a047e93361ef71ceb9f0a8faccffe32746daa
parentAssert the record count of ebuild_masks (diff)
downloadgentoobrowse-api-283197a60fbdb0a594b2fe05b8faf6aa0e8abd00.tar.bz2
gentoobrowse-api-283197a60fbdb0a594b2fe05b8faf6aa0e8abd00.tar.xz
gentoobrowse-api-283197a60fbdb0a594b2fe05b8faf6aa0e8abd00.zip
Add support for a phase end event in maintenance processors which is called even if the processor never processed any changes
-rw-r--r--gentoobrowse-api/service/maintenance/abstractFileProcessor.cpp6
-rw-r--r--gentoobrowse-api/service/maintenance/abstractFileProcessor.h1
-rw-r--r--gentoobrowse-api/service/maintenanceGitOperations.cpp3
3 files changed, 9 insertions, 1 deletions
diff --git a/gentoobrowse-api/service/maintenance/abstractFileProcessor.cpp b/gentoobrowse-api/service/maintenance/abstractFileProcessor.cpp
index 52fa266..d63d01a 100644
--- a/gentoobrowse-api/service/maintenance/abstractFileProcessor.cpp
+++ b/gentoobrowse-api/service/maintenance/abstractFileProcessor.cpp
@@ -20,10 +20,14 @@ namespace Gentoo {
}
void
- AbstractFileProcessor::tidy(DB::Connection *)
+ AbstractFileProcessor::phaseEnd(DB::Connection *, ChangeSet &)
{
}
+ void
+ AbstractFileProcessor::tidy(DB::Connection *)
+ {
+ }
}
}
diff --git a/gentoobrowse-api/service/maintenance/abstractFileProcessor.h b/gentoobrowse-api/service/maintenance/abstractFileProcessor.h
index d25fb70..4b9db3b 100644
--- a/gentoobrowse-api/service/maintenance/abstractFileProcessor.h
+++ b/gentoobrowse-api/service/maintenance/abstractFileProcessor.h
@@ -21,6 +21,7 @@ namespace Gentoo {
virtual void prepare(DB::Connection *);
virtual void apply(DB::Connection *, ChangeSet &);
+ virtual void phaseEnd(DB::Connection *, ChangeSet &);
virtual void tidy(DB::Connection *);
virtual void created(DB::Connection * dbc, int64_t repoid, const Gentoo::StringList & fn, const boost::filesystem::path & path) = 0;
diff --git a/gentoobrowse-api/service/maintenanceGitOperations.cpp b/gentoobrowse-api/service/maintenanceGitOperations.cpp
index cd463db..59470c6 100644
--- a/gentoobrowse-api/service/maintenanceGitOperations.cpp
+++ b/gentoobrowse-api/service/maintenanceGitOperations.cpp
@@ -227,6 +227,9 @@ namespace Gentoo {
for (const auto & processor : usedProcessors) {
processor->apply(dbc, changes);
}
+ for (const auto & processor : phase.second) {
+ processor.second->phaseEnd(dbc, changes);
+ }
}
for (const auto & phase : fps) {
for (const auto & processor : phase.second) {