Move start of transaction down to actual database methods

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
Thomas Lauf 2020-07-17 17:53:59 +02:00
parent b5aec4db8b
commit 06a4235b10

View file

@ -52,8 +52,6 @@ int CmdContinue (
throw std::string ("You can only specify one ID to continue."); throw std::string ("You can only specify one ID to continue.");
} }
journal.startTransaction ();
Interval to_copy; Interval to_copy;
if (ids.size() == 1) if (ids.size() == 1)
@ -115,9 +113,9 @@ int CmdContinue (
to_copy.start = start_time; to_copy.start = start_time;
to_copy.end = end_time; to_copy.end = end_time;
journal.startTransaction ();
validate (cli, rules, database, to_copy); validate (cli, rules, database, to_copy);
database.addInterval (to_copy, verbose); database.addInterval (to_copy, verbose);
journal.endTransaction (); journal.endTransaction ();
if (verbose) if (verbose)