Authen::Passphrase 0
Authen::Passphrase::BlowfishCrypt 0
+ Class::Method::Modifiers 0
Date::Parse 0
DBIx::Class 0
File::Slurp 0
use parent qw/Exporter/;
our $VERSION = '5999.000_012';
-our @EXPORT = qw/purge/;
+our @EXPORT = qw/purge/; ## no critic (ProhibitAutomaticExportation)
use Lingua::EN::Inflect qw/PL_N/;
use JSON::MaybeXS qw/decode_json/;
my @PURGE_HOSTS = exists $ENV{PURGE_HOSTS} ? split ' ', $ENV{PURGE_HOSTS} : ();
my $ht = HTTP::Tiny->new;
-sub purge { $ht->request(PURGE => "http://$_$_[0]") for @PURGE_HOSTS }
-
+sub purge {
+ $ht->request(PURGE => "http://$_$_[0]") for @PURGE_HOSTS;
+}
1;
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:54:00
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IxxZqQwKisBwDabCNUD55Q
+use Class::Method::Modifiers qw/after/;
use List::Util qw/sum/;
+after qw/insert update delete/ => sub {
+ my ($self) = @_;
+ Gruntmaster::Data::purge '/ct/';
+ Gruntmaster::Data::purge '/ct/' . $self->id;
+};
+
sub is_pending {
my ($self, $time) = @_;
$self->start > ($time // time)
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:44:22
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dTFBC3ZKB2T9SCiyQxxe2w
+use Class::Method::Modifiers qw/after/;
+
sub rawcontest { shift->get_column('contest') }
sub rawproblem { shift->get_column('problem') }
+after qw/insert update delete/ => sub {
+ my ($self) = @_;
+ Gruntmaster::Data::purge '/pb/';
+ Gruntmaster::Data::purge '/pb/' . $self->rawproblem;
+};
+
1;
__END__
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:44:22
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IkY4FNON0SrxrP8oNOXoHg
+use Class::Method::Modifiers qw/after/;
+
sub rawowner { shift->get_column('owner') }
+after qw/insert update delete/ => sub {
+ my ($self) = @_;
+ Gruntmaster::Data::purge '/us/';
+ Gruntmaster::Data::purge '/us/' . $self->rawowner;
+};
+
1;
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:54:00
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hEAVL5heV13+nalSmgr0WA
+use Class::Method::Modifiers qw/after/;
+
sub rawcontest { shift->get_column('contest') }
sub rawowner { shift->get_column('owner') }
sub rawproblem { shift->get_column('problem') }
shift->update({daemon => undef, result => -2, result_text => undef});
}
+after qw/insert update delete/ => sub {
+ my ($self) = @_;
+ Gruntmaster::Data::purge '/us/';
+ Gruntmaster::Data::purge '/us/' . $self->rawowner;
+ Gruntmaster::Data::purge '/st/' . $self->rawcontest if $self->rawcontest;
+ Gruntmaster::Data::purge '/log/';
+ Gruntmaster::Data::purge '/log/' . $self->id;
+};
+
1;
__END__
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:44:22
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jAao0vjOW87mO37ZQhm4Cw
+use Class::Method::Modifiers qw/after/;
+
+sub rawcontest { shift->get_column('contest') }
sub rawowner { shift->get_column('owner') }
sub rawproblem { shift->get_column('problem') }
+after qw/insert update delete/ => sub {
+ my ($self) = @_;
+ Gruntmaster::Data::purge '/st/' . $self->rawcontest;
+};
+
1;
__END__
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:54:00
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QZHyWOWaPmTm/EQ5M22CGA
+use Class::Method::Modifiers qw/after/;
+
+after qw/insert update delete/ => sub {
+ my ($self) = @_;
+ Gruntmaster::Data::purge '/pb/';
+ Gruntmaster::Data::purge '/pb/' . $self->id;
+};
+
sub is_private {
my ($self, $time) = @_;
return 1 if $self->private;
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:44:22
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1OCTO6sM27DamVhQi3dWKg
+use Class::Method::Modifiers qw/after/;
+
sub rawowner { shift->get_column('owner') }
+after qw/insert update delete/ => sub {
+ my ($self) = @_;
+ Gruntmaster::Data::purge '/us/';
+ Gruntmaster::Data::purge '/us/' . $self->rawowner;
+};
+
1;
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:54:00
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LiA2+ZpTTelwZJtFpZRsbw
+use Class::Method::Modifiers qw/after/;
+
+after qw/insert update delete/ => sub {
+ my ($self) = @_;
+ Gruntmaster::Data::purge '/us/';
+ Gruntmaster::Data::purge '/us/' . $self->id;
+};
+
use Authen::Passphrase;
use Authen::Passphrase::BlowfishCrypt;