mirror of
https://github.com/NixOS/hydra.git
synced 2024-10-22 22:59:17 +02:00
Better update of timeout for the PathInput handler.
This commit is contained in:
parent
66730993fc
commit
23fa93c5f8
|
@ -12,13 +12,15 @@ sub supportedInputTypes {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub _parseValue {
|
sub _parseValue {
|
||||||
my ($value) = @_;
|
# The input is a local path or URL, optionally followed by a
|
||||||
|
# time period specified in seconds.
|
||||||
|
my ($config, $value) = @_;
|
||||||
my @parts = split ' ', $value;
|
my @parts = split ' ', $value;
|
||||||
(my $uri, my $freq) = @parts;
|
(my $uri, my $freq) = @parts;
|
||||||
# by default don't check a path more often than every 30 seconds,
|
# By default don't check a path more often than every 30 seconds,
|
||||||
# but the second path argument can change that value or the global
|
# but the second path argument can change that value or the global
|
||||||
# path_input_cache_validity_seconds configuration, in that order.
|
# path_input_cache_validity_seconds configuration, in that order.
|
||||||
my $timeout = defined $freq ? $freq : ($self->{config}->{path_input_cache_validity_seconds} // 30);
|
my $timeout = defined $freq ? $freq : ($config->{path_input_cache_validity_seconds} // 30);
|
||||||
|
|
||||||
return ($uri, $timeout);
|
return ($uri, $timeout);
|
||||||
}
|
}
|
||||||
|
@ -28,7 +30,7 @@ sub fetchInput {
|
||||||
|
|
||||||
return undef if $type ne "path";
|
return undef if $type ne "path";
|
||||||
|
|
||||||
my ($uri, $timeout) = _parseValue($value);
|
my ($uri, $timeout) = _parseValue($self->{config}, $value);
|
||||||
|
|
||||||
my $timestamp = time;
|
my $timestamp = time;
|
||||||
my $sha256;
|
my $sha256;
|
||||||
|
|
Loading…
Reference in a new issue