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:
@ -58,7 +58,7 @@ sub fetchInput {
|
||||
# FIXME: time window between nix-prefetch-bzr and addTempRoot.
|
||||
addTempRoot($storePath);
|
||||
|
||||
txn_do($self->{db}, sub {
|
||||
$self->{db}->txn_do(sub {
|
||||
$self->{db}->resultset('CachedBazaarInputs')->create(
|
||||
{ uri => $uri
|
||||
, revision => $revision
|
||||
|
@ -77,7 +77,7 @@ sub fetchInput {
|
||||
$sha256 = queryPathHash($storePath);
|
||||
$sha256 =~ s/sha256://;
|
||||
|
||||
txn_do($self->{db}, sub {
|
||||
$self->{db}->txn_do(sub {
|
||||
$self->{db}->resultset('CachedDarcsInputs')->update_or_create(
|
||||
{ uri => $uri
|
||||
, revision => $revision
|
||||
|
@ -218,7 +218,7 @@ sub fetchInput {
|
||||
# FIXME: time window between nix-prefetch-git and addTempRoot.
|
||||
addTempRoot($storePath);
|
||||
|
||||
txn_do($self->{db}, sub {
|
||||
$self->{db}->txn_do(sub {
|
||||
$self->{db}->resultset('CachedGitInputs')->update_or_create(
|
||||
{ uri => $uri
|
||||
, branch => $branch
|
||||
|
@ -85,7 +85,7 @@ sub fetchInput {
|
||||
# FIXME: time window between nix-prefetch-hg and addTempRoot.
|
||||
addTempRoot($storePath);
|
||||
|
||||
txn_do($self->{db}, sub {
|
||||
$self->{db}->txn_do(sub {
|
||||
$self->{db}->resultset('CachedHgInputs')->update_or_create(
|
||||
{ uri => $uri
|
||||
, branch => $branch
|
||||
|
@ -54,7 +54,7 @@ sub fetchInput {
|
||||
# changes, we get a new "revision", but if it doesn't change
|
||||
# (or changes back), we don't get a new "revision".
|
||||
if (!defined $cachedInput) {
|
||||
txn_do($self->{db}, sub {
|
||||
$self->{db}->txn_do(sub {
|
||||
$self->{db}->resultset('CachedPathInputs')->update_or_create(
|
||||
{ srcpath => $uri
|
||||
, timestamp => $timestamp
|
||||
@ -65,7 +65,7 @@ sub fetchInput {
|
||||
});
|
||||
} else {
|
||||
$timestamp = $cachedInput->timestamp;
|
||||
txn_do($self->{db}, sub {
|
||||
$self->{db}->txn_do(sub {
|
||||
$cachedInput->update({lastseen => time});
|
||||
});
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ sub fetchInput {
|
||||
|
||||
$sha256 = queryPathHash($storePath); $sha256 =~ s/sha256://;
|
||||
|
||||
txn_do($self->{db}, sub {
|
||||
$self->{db}->txn_do(sub {
|
||||
$self->{db}->resultset('CachedSubversionInputs')->update_or_create(
|
||||
{ uri => $uri
|
||||
, revision => $revision
|
||||
|
Reference in New Issue
Block a user