}
sub localconfig {
- return $_[0]->process_cache->{localconfig} ||= Bugzilla::Localconfig->new(read_localconfig());
+ return $_[0]->process_cache->{localconfig}
+ ||= Bugzilla::Localconfig->new(read_localconfig());
}
}
}
else {
- my $dbh = Bugzilla->dbh_main;
+ my $dbh = Bugzilla->dbh_main;
my $date = $dbh->sql_date_math('NOW()', '+', '?', 'DAY');
my ($mfa_required_date)
= $dbh->selectrow_array("SELECT $date", undef, $grace_period);
# If Mojo native app is requesting login, we need to possibly redirect
my $C = $Bugzilla::App::CGI::C;
+ if ($class->user->id) {
+ $C->res->headers->cache_control('private, max-age=60');
+ }
+ else {
+ $C->res->headers->cache_control('public, max-age=300');
+ }
my $session = $C->session;
if (!$on_token_page && $session->{override_login_target}) {
my $override_login_target = delete $session->{override_login_target};
my $fields = $cache->{fields};
my %requested;
if (my $types = delete $criteria->{type}) {
- $types = ref($types) ? $types : [$types];
+ $types = ref($types) ? $types : [$types];
%requested = map { %{$fields->{by_type}->{$_} || {}} } @$types;
}
else {
sub active_custom_fields {
my (undef, $params, $wants) = @_;
- my $cache_id = 'active_custom_fields';
+ my $cache_id = 'active_custom_fields';
my $can_cache = !exists $params->{bug_id} && !$wants;
if ($can_cache && $params) {
$cache_id .= ($params->{product} ? '_p' . $params->{product}->id : '')
sub clear_request_cache {
my (undef, %option) = @_;
my $request_cache = request_cache();
- my @except = $option{except} ? @{$option{except}} : ();
+ my @except = $option{except} ? @{$option{except}} : ();
%{$request_cache} = map { $_ => $request_cache->{$_} } @except;
}
my $main = Bugzilla->request_cache->{dbh_main};
my $shadow = Bugzilla->request_cache->{dbh_shadow};
foreach my $dbh ($main, $shadow) {
- next if !$dbh;
+ next if !$dbh;
$dbh->bz_rollback_transaction() if $dbh->bz_in_transaction;
}
clear_request_cache();