diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-04-21 16:05:13 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-04-21 16:05:13 +0200 |
commit | 2a0f39b29c1bea6a4497c0f1826052ffa453af9e (patch) | |
tree | 283f6bf1569c1b9f00b6e25fe986ccfff8a8629f /brep/database-module.cxx | |
parent | c6b4d6c6489731eedba606d3c85c4319c4478b50 (diff) |
Move module implementation from brep/ to mod/
Diffstat (limited to 'brep/database-module.cxx')
-rw-r--r-- | brep/database-module.cxx | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/brep/database-module.cxx b/brep/database-module.cxx deleted file mode 100644 index 630fd89..0000000 --- a/brep/database-module.cxx +++ /dev/null @@ -1,50 +0,0 @@ -// file : brep/database-module.cxx -*- C++ -*- -// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#include <brep/database-module> - -#include <odb/exceptions.hxx> - -#include <brep/options> -#include <brep/database> - -namespace brep -{ - // While currently the user-defined copy constructor is not required (we - // don't need to deep copy nullptr's), it is a good idea to keep the - // placeholder ready for less trivial cases. - // - database_module:: - database_module (const database_module& r) - : module (r), - retry_ (r.retry_), - db_ (r.initialized_ ? r.db_ : nullptr) - { - } - - void database_module:: - init (const options::db& o) - { - retry_ = o.db_retry (); - db_ = shared_database (o); - } - - bool database_module:: - handle (request& rq, response& rs, log& l) - try - { - return module::handle (rq, rs, l); - } - catch (const odb::recoverable& e) - { - if (retry_-- > 0) - { - MODULE_DIAG; - l1 ([&]{trace << e.what () << "; " << retry_ + 1 << " retries left";}); - throw retry (); - } - - throw; - } -} |