Skip to content

Commit bd56a44

Browse files
committed
Adjust the config location
1 parent 5e5c1f2 commit bd56a44

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

lib/VWF/Allow.pm

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,16 @@ sub allow {
109109
Data::Throttler->import();
110110

111111
my $interval = 90;
112-
my $max_items = 15;
112+
my $max_items = 30;
113+
my $db_file = File::Spec->catfile($info->tmpdir(), 'throttle');
113114
if(my $config = $args{config}) {
114-
$interval = $config->{'security'}->{'rate_limiting'}->{'time_window'} || 90;
115-
$max_items = $config->{'security'}->{'rate_limiting'}->{'max_requests'} || 15;
115+
if(my $throttle = $config->{throttle}) {
116+
$db_file = $throttle->{'file'} // File::Spec->catdir($info->tmpdir(), 'throttle');
117+
$max_items = $throttle->{'max_items'} // 30; # Allow 30 requests
118+
$interval = $throttle->{'interval'} // 90; # Per 90 second window
119+
}
116120
}
117121
# Handle YAML Errors
118-
my $db_file = File::Spec->catfile($info->tmpdir(), 'throttle');
119122
eval {
120123
my $throttler = Data::Throttler->new(
121124
max_items => $max_items,

0 commit comments

Comments
 (0)