Remove Hydra::Helper::nix::txn_do from the Perl code

To quote the function's comment:

  Awful hack to handle timeouts in SQLite: just retry the transaction.
  DBD::SQLite *has* a 30 second retry window, but apparently it
  doesn't work.

Since SQLite is now dropped entirely, this wrapper can be removed
completely.
This commit is contained in:
Maximilian Bosch
2020-04-10 18:13:36 +02:00
parent efcbc08686
commit 721c764951
18 changed files with 34 additions and 50 deletions

View File

@ -62,7 +62,7 @@ sub jobset_PUT {
}
if (defined $c->stash->{jobset}) {
txn_do($c->model('DB')->schema, sub {
$c->model('DB')->schema->txn_do(sub {
updateJobset($c, $c->stash->{jobset});
});
@ -74,7 +74,7 @@ sub jobset_PUT {
else {
my $jobset;
txn_do($c->model('DB')->schema, sub {
$c->model('DB')->schema->txn_do(sub {
# Note: $jobsetName is validated in updateProject, which will
# abort the transaction if the name isn't valid.
$jobset = $c->stash->{project}->jobsets->create(
@ -100,7 +100,7 @@ sub jobset_DELETE {
error($c, "can't modify jobset of declarative project", 403);
}
txn_do($c->model('DB')->schema, sub {
$c->model('DB')->schema->txn_do(sub {
$c->stash->{jobset}->jobsetevals->delete;
$c->stash->{jobset}->builds->delete;
$c->stash->{jobset}->delete;