summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2017-11-05 20:21:10 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2017-11-05 20:21:10 +0000
commit46369877987bfbe711edf376dd5b8b1372a4a8b7 (patch)
tree979817b261279e04259a47079b98d6a5179eee27
parentInternal models can be local (diff)
downloadp2pvr-46369877987bfbe711edf376dd5b8b1372a4a8b7.tar.bz2
p2pvr-46369877987bfbe711edf376dd5b8b1372a4a8b7.tar.xz
p2pvr-46369877987bfbe711edf376dd5b8b1372a4a8b7.zip
Release events update transaction before beginning reschedule
-rw-r--r--p2pvr/daemon/maintenance/events.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/p2pvr/daemon/maintenance/events.cpp b/p2pvr/daemon/maintenance/events.cpp
index fbdeb51..30e0a83 100644
--- a/p2pvr/daemon/maintenance/events.cpp
+++ b/p2pvr/daemon/maintenance/events.cpp
@@ -84,7 +84,7 @@ MaintenanceI::UpdateEvents(const Ice::Current & ice)
SiEventsStream stream(ice, dbc.get(), logger);
- DB::TransactionScope tx(dbc.get());
+ auto tx = std::make_unique<DB::TransactionScope>(dbc.get());
DB::TablePatch tp;
tp.dest = "events";
tp.insteadOfDelete = new DB::StaticSqlWriter("current = false");
@@ -93,6 +93,7 @@ MaintenanceI::UpdateEvents(const Ice::Current & ice)
sql::maintenance::pruneEvents.modify(dbc.get())->execute();
+ tx = nullptr;
logger->messagebf(LOG::INFO, "%s: Updated events", __PRETTY_FUNCTION__);
auto sch = SchedulesPrx::checkedCast(ice.adapter->createProxy(ic->stringToIdentity("Schedules")));