JSON -> JSON::MaybeXS
This commit is contained in:
@ -5,7 +5,7 @@ use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class';
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
|
||||
sub TO_JSON {
|
||||
my $self = shift;
|
||||
@ -27,7 +27,7 @@ sub TO_JSON {
|
||||
}
|
||||
|
||||
foreach my $column (@{$hint->{boolean_columns}}) {
|
||||
$json{$column} = $self->get_column($column) ? JSON::true : JSON::false;
|
||||
$json{$column} = $self->get_column($column) ? JSON::MaybeXS::true : JSON::MaybeXS::false;
|
||||
}
|
||||
|
||||
foreach my $relname (keys %{$hint->{relations}}) {
|
||||
|
@ -7,7 +7,6 @@ use base 'Hydra::Base::Controller::REST';
|
||||
use Hydra::Helper::Nix;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
use Hydra::Controller::Project;
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
use DateTime;
|
||||
use Digest::SHA qw(sha256_hex);
|
||||
@ -87,7 +86,7 @@ sub jobsetToHash {
|
||||
triggertime => $jobset->triggertime,
|
||||
fetcherrormsg => $jobset->fetcherrormsg,
|
||||
errortime => $jobset->errortime,
|
||||
haserrormsg => defined($jobset->errormsg) && $jobset->errormsg ne "" ? JSON::true : JSON::false
|
||||
haserrormsg => defined($jobset->errormsg) && $jobset->errormsg ne "" ? JSON::MaybeXS::true : JSON::MaybeXS::false
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ use Nix::Store;
|
||||
use Nix::Config;
|
||||
use Encode;
|
||||
use File::Basename;
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
use List::Util qw[min max];
|
||||
use List::MoreUtils qw{any};
|
||||
use Net::Prometheus;
|
||||
|
@ -11,7 +11,7 @@ use Hydra::Helper::Nix;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
use Hydra::Helper::Email;
|
||||
use LWP::UserAgent;
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
use HTML::Entities;
|
||||
use Encode qw(decode);
|
||||
|
||||
|
@ -4,7 +4,7 @@ use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
use Encode;
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
use Nix::Store;
|
||||
use Nix::Config;
|
||||
use Hydra::Model::DB;
|
||||
|
@ -5,7 +5,7 @@ use warnings;
|
||||
use parent 'Hydra::Plugin';
|
||||
use HTTP::Request;
|
||||
use LWP::UserAgent;
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
use File::Temp;
|
||||
use POSIX qw(strftime);
|
||||
|
@ -4,7 +4,7 @@ use strict;
|
||||
use warnings;
|
||||
use parent 'Hydra::Plugin';
|
||||
use HTTP::Request;
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
use LWP::UserAgent;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
|
||||
|
@ -6,7 +6,7 @@ use parent 'Hydra::Plugin';
|
||||
use HTTP::Request;
|
||||
use LWP::UserAgent;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
|
||||
sub isEnabled {
|
||||
my ($self) = @_;
|
||||
|
@ -5,7 +5,7 @@ use warnings;
|
||||
use parent 'Hydra::Plugin';
|
||||
|
||||
use HTTP::Request;
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
use LWP::UserAgent;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
use List::Util qw(max);
|
||||
|
@ -5,7 +5,7 @@ use warnings;
|
||||
use parent 'Hydra::Plugin';
|
||||
use HTTP::Request;
|
||||
use LWP::UserAgent;
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
use File::Temp;
|
||||
use POSIX qw(strftime);
|
||||
|
@ -5,7 +5,7 @@ use warnings;
|
||||
use parent 'Hydra::Plugin';
|
||||
use HTTP::Request;
|
||||
use LWP::UserAgent;
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
use File::Temp;
|
||||
use POSIX qw(strftime);
|
||||
|
@ -4,7 +4,7 @@ use strict;
|
||||
use warnings;
|
||||
use parent 'Hydra::Plugin';
|
||||
use HTTP::Request;
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
use LWP::UserAgent;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
use List::Util qw(max);
|
||||
|
@ -19,7 +19,7 @@ use warnings;
|
||||
use parent 'Hydra::Plugin';
|
||||
use HTTP::Request;
|
||||
use LWP::UserAgent;
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
use File::Temp;
|
||||
use POSIX qw(strftime);
|
||||
|
@ -4,7 +4,7 @@ use strict;
|
||||
use warnings;
|
||||
use parent 'Hydra::Plugin';
|
||||
use HTTP::Request;
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
use LWP::UserAgent;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
use List::Util qw(max);
|
||||
|
@ -4,7 +4,7 @@ use strict;
|
||||
use warnings;
|
||||
use parent 'Hydra::Plugin';
|
||||
use experimental 'smartmatch';
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
|
||||
sub isEnabled {
|
||||
my ($self) = @_;
|
||||
@ -74,7 +74,7 @@ sub makeJsonPayload {
|
||||
my $json = {
|
||||
event => $event,
|
||||
build => $build->id,
|
||||
finished => $build->get_column('finished') ? JSON::true : JSON::false,
|
||||
finished => $build->get_column('finished') ? JSON::MaybeXS::true : JSON::MaybeXS::false,
|
||||
timestamp => $build->get_column('timestamp'),
|
||||
project => $build->get_column('project'),
|
||||
jobset => $build->get_column('jobset'),
|
||||
|
@ -6,7 +6,7 @@ use parent 'Hydra::Plugin';
|
||||
use HTTP::Request;
|
||||
use LWP::UserAgent;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
@ -134,7 +134,7 @@ __PACKAGE__->has_many(
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CkU+hbVTmhfOzQhkHJHCsg
|
||||
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
|
||||
sub as_json {
|
||||
my $self = shift;
|
||||
@ -148,7 +148,7 @@ sub as_json {
|
||||
"value" => $input->value // "",
|
||||
|
||||
# boolean_columns
|
||||
"emailresponsible" => $self->get_column("emailresponsible") ? JSON::true : JSON::false,
|
||||
"emailresponsible" => $self->get_column("emailresponsible") ? JSON::MaybeXS::true : JSON::MaybeXS::false,
|
||||
);
|
||||
|
||||
return \%json;
|
||||
|
@ -375,7 +375,7 @@ __PACKAGE__->has_many(
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iI44C3BFTo6IsS1tBwWYsg
|
||||
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
|
||||
=head2 builds
|
||||
|
||||
@ -423,8 +423,8 @@ sub as_json {
|
||||
"flake" => $self->get_column("flake") // "",
|
||||
|
||||
# boolean_columns
|
||||
"enableemail" => $self->get_column("enableemail") ? JSON::true : JSON::false,
|
||||
"visible" => $self->get_column("hidden") ? JSON::false : JSON::true,
|
||||
"enableemail" => $self->get_column("enableemail") ? JSON::MaybeXS::true : JSON::MaybeXS::false,
|
||||
"visible" => $self->get_column("hidden") ? JSON::MaybeXS::false : JSON::MaybeXS::true,
|
||||
|
||||
"inputs" => { map { $_->name => $_ } $self->jobsetinputs }
|
||||
);
|
||||
|
@ -246,7 +246,7 @@ __PACKAGE__->many_to_many("usernames", "projectmembers", "username");
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nKVZ8ZNCZQQ52zbpDAaoQQ
|
||||
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
|
||||
sub as_json {
|
||||
my $self = shift;
|
||||
@ -260,8 +260,8 @@ sub as_json {
|
||||
"owner" => $self->get_column("owner") // "",
|
||||
|
||||
# boolean_columns
|
||||
"enabled" => $self->get_column("enabled") ? JSON::true : JSON::false,
|
||||
"hidden" => $self->get_column("hidden") ? JSON::true : JSON::false,
|
||||
"enabled" => $self->get_column("enabled") ? JSON::MaybeXS::true : JSON::MaybeXS::false,
|
||||
"hidden" => $self->get_column("hidden") ? JSON::MaybeXS::true : JSON::MaybeXS::false,
|
||||
|
||||
"jobsets" => [ map { $_->name } $self->jobsets ]
|
||||
);
|
||||
|
@ -15,7 +15,7 @@ use Hydra::Helper::Nix;
|
||||
use Hydra::Model::DB;
|
||||
use Hydra::Plugin;
|
||||
use Hydra::Schema;
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
use Net::Statsd;
|
||||
use Nix::Store;
|
||||
use Time::HiRes qw(clock_gettime CLOCK_MONOTONIC);
|
||||
|
@ -6,7 +6,7 @@ use utf8;
|
||||
use Hydra::Helper::Nix;
|
||||
use Net::Statsd;
|
||||
use File::Slurper qw(read_text);
|
||||
use JSON;
|
||||
use JSON::MaybeXS;
|
||||
use Getopt::Long qw(:config gnu_getopt);
|
||||
|
||||
STDERR->autoflush(1);
|
||||
|
Reference in New Issue
Block a user