Context
- Removed the auto_commit feature, because now every command call TDB2::commit, in case a hook script generated new tasks. This is harmless in NOP situations.
This commit is contained in:
@@ -392,15 +392,12 @@ int Context::dispatch (std::string &out)
|
|||||||
updateVerbosity ();
|
updateVerbosity ();
|
||||||
|
|
||||||
Command* c = commands[command];
|
Command* c = commands[command];
|
||||||
|
assert (c);
|
||||||
|
|
||||||
// GC is invoked prior to running any command that displays task IDs, if
|
// GC is invoked prior to running any command that displays task IDs, if
|
||||||
// possible.
|
// possible.
|
||||||
bool auto_commit = false;
|
|
||||||
if (c->displays_id () && !tdb2.read_only ())
|
if (c->displays_id () && !tdb2.read_only ())
|
||||||
{
|
|
||||||
tdb2.gc ();
|
tdb2.gc ();
|
||||||
auto_commit = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only read-only commands can be run when TDB2 is read-only.
|
// Only read-only commands can be run when TDB2 is read-only.
|
||||||
// TODO Implement TDB2::read_only
|
// TODO Implement TDB2::read_only
|
||||||
@@ -410,8 +407,6 @@ int Context::dispatch (std::string &out)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int rc = c->execute (out);
|
int rc = c->execute (out);
|
||||||
if (auto_commit)
|
|
||||||
tdb2.commit ();
|
|
||||||
|
|
||||||
// Write commands cause an update of the shadow file, if configured.
|
// Write commands cause an update of the shadow file, if configured.
|
||||||
if (! c->read_only ())
|
if (! c->read_only ())
|
||||||
|
|||||||
Reference in New Issue
Block a user