summaryrefslogtreecommitdiff
path: root/server/src/journal_uploadserver.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2012-08-23 13:31:57 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2012-08-23 13:31:57 +0200
commit07694570b09524881d01df7c857cc8f471f1ad04 (patch)
tree8cae77df7bb081c1b7d37a587d11c765769d3643 /server/src/journal_uploadserver.cc
parent05732251c115b3538879ca523c461572115c6526 (diff)
parent909c48a297d7f68b107fce7ad444c2165f749f42 (diff)
Merge branch 'master' of http://git.aasimon.org/public/pracro
Diffstat (limited to 'server/src/journal_uploadserver.cc')
-rw-r--r--server/src/journal_uploadserver.cc26
1 files changed, 17 insertions, 9 deletions
diff --git a/server/src/journal_uploadserver.cc b/server/src/journal_uploadserver.cc
index a1299ec..eac6cd5 100644
--- a/server/src/journal_uploadserver.cc
+++ b/server/src/journal_uploadserver.cc
@@ -163,7 +163,10 @@ JournalUploadServer::JournalUploadServer(std::string host,
}
void JournalUploadServer::commit()
+ throw(Journal::Exception)
{
+ int ret = 0;
+
#ifdef USE_MULTIPLE_USERS
std::string resume;
std::string olduser;
@@ -177,9 +180,12 @@ void JournalUploadServer::commit()
}
if(i->second.user != olduser && olduser != "" && resume != "") {
- journal_commit(patientID().c_str(), olduser.c_str(),
- host.c_str(), port,
- resume.c_str(), resume.size());
+ ret = journal_commit(patientID().c_str(), olduser.c_str(),
+ host.c_str(), port,
+ resume.c_str(), resume.size());
+
+ if(ret == -1) throw Journal::Exception("Journal Commit error.");
+
// FIXME - UGLY HACK: Avoid upload server spooling in the wrong order.
usleep(200000);
resume = "";
@@ -195,9 +201,9 @@ void JournalUploadServer::commit()
if(resume == "") return;
- journal_commit(patientID().c_str(), olduser.c_str(),
- host.c_str(), port,
- resume.c_str(), resume.size());
+ ret = journal_commit(patientID().c_str(), olduser.c_str(),
+ host.c_str(), port,
+ resume.c_str(), resume.size());
#else
std::string resume;
std::string user;
@@ -222,10 +228,12 @@ void JournalUploadServer::commit()
if(resume == "") return;
// Connect to praxisuploadserver and commit all resumes in one bulk.
- journal_commit(patientID().c_str(), user.c_str(),
- host.c_str(), port,
- resume.c_str(), resume.size());
+ ret = journal_commit(patientID().c_str(), user.c_str(),
+ host.c_str(), port,
+ resume.c_str(), resume.size());
#endif/*USE_MULTIPLE_USERS*/
+
+ if(ret == -1) throw Journal::Exception("Journal Commit error.");
}