X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FDB%2FResultSet%2FBugStatusCache.pm;fp=Debbugs%2FDB%2FResultSet%2FBugStatusCache.pm;h=0000000000000000000000000000000000000000;hb=1e6633a3780f4fd53fc4303852e84d13cdad2dc6;hp=7ad8f0e3a04e706c0f497e3573da66ee6fc463e6;hpb=466f7faff129a5699c7674f59900a92aa256175d;p=debbugs.git diff --git a/Debbugs/DB/ResultSet/BugStatusCache.pm b/Debbugs/DB/ResultSet/BugStatusCache.pm deleted file mode 100644 index 7ad8f0e..0000000 --- a/Debbugs/DB/ResultSet/BugStatusCache.pm +++ /dev/null @@ -1,74 +0,0 @@ -# This module is part of debbugs, and is released -# under the terms of the GPL version 2, or any later version. See the -# file README and COPYING for more information. -# Copyright 2017 by Don Armstrong . -use utf8; -package Debbugs::DB::ResultSet::BugStatusCache; - -=head1 NAME - -Debbugs::DB::ResultSet::BugStatusCache - Bug result set operations - -=head1 SYNOPSIS - - - -=head1 DESCRIPTION - - - -=cut - -use strict; -use warnings; - -use base 'DBIx::Class::ResultSet'; - -use Debbugs::DB::Util qw(select_one); - -use List::AllUtils qw(natatime); - - -=over - -=item update_bug_status - - $s->resultset('BugStatusCache')-> - update_bug_status($bug->id, - $suite->{id}, - undef, - $presence, - ); - -Update the status information for a particular bug at a particular suite - -=cut - -sub update_bug_status { - my ($self,@args) = @_; - return $self->result_source->schema->storage-> - dbh_do(sub { - my ($s,$dbh,$bug,$suite,$arch,$status,$modified,$asof) = @_; - select_one($dbh,<<'SQL',$bug,$suite,$arch,$status,$status); -INSERT INTO bug_status_cache AS bsc -(bug,suite,arch,status,modified,asof) -VALUES (?,?,?,?,NOW(),NOW()) -ON CONFLICT (bug,COALESCE(suite,0),COALESCE(arch,0)) DO -UPDATE - SET asof=NOW(),modified=CASE WHEN bsc.status=? THEN bsc.modified ELSE NOW() END -RETURNING status; -SQL - }, - @args - ); -} - - -=back - -=cut - - -1; - -__END__