From e96916533f6a326ab63fbe2c11d87b8a6dee4668 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 2 May 2013 17:51:38 +0200 Subject: [PATCH] Allow a per-jobset check interval This allows checking a jobset (say) at most once a day. It's also possible to disable polling by setting the interval to 0. This is useful for jobsets that use push notification or are manually evaluated. --- src/lib/Hydra/Controller/Jobset.pm | 3 ++- src/lib/Hydra/Schema/Jobsets.pm | 12 ++++++++++-- src/root/edit-jobset.tt | 11 +++++++++++ src/root/jobset.tt | 4 ++++ src/script/hydra-evaluator | 7 ++++--- src/sql/hydra.sql | 1 + src/sql/upgrade-12.sql | 1 - src/sql/upgrade-13.sql | 1 + 8 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 src/sql/upgrade-13.sql diff --git a/src/lib/Hydra/Controller/Jobset.pm b/src/lib/Hydra/Controller/Jobset.pm index 0352d656..00fbf4ef 100644 --- a/src/lib/Hydra/Controller/Jobset.pm +++ b/src/lib/Hydra/Controller/Jobset.pm @@ -206,7 +206,8 @@ sub updateJobset { , enableemail => defined $c->request->params->{enableemail} ? 1 : 0 , emailoverride => trim($c->request->params->{emailoverride}) || "" , hidden => defined $c->request->params->{visible} ? 0 : 1 - , keepnr => trim($c->request->params->{keepnr}) || 3 + , keepnr => int(trim($c->request->params->{keepnr})) || 3 + , checkinterval => int(trim($c->request->params->{checkinterval})) , triggertime => $jobset->triggertime // time() }); diff --git a/src/lib/Hydra/Schema/Jobsets.pm b/src/lib/Hydra/Schema/Jobsets.pm index 649043e4..97ccdceb 100644 --- a/src/lib/Hydra/Schema/Jobsets.pm +++ b/src/lib/Hydra/Schema/Jobsets.pm @@ -100,6 +100,12 @@ __PACKAGE__->table("Jobsets"); default_value: 3 is_nullable: 0 +=head2 checkinterval + + data_type: 'integer' + default_value: 300 + is_nullable: 0 + =cut __PACKAGE__->add_columns( @@ -131,6 +137,8 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 0 }, "keepnr", { data_type => "integer", default_value => 3, is_nullable => 0 }, + "checkinterval", + { data_type => "integer", default_value => 300, is_nullable => 0 }, ); =head1 PRIMARY KEY @@ -252,7 +260,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-02-25 19:10:12 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SvBgR0iH9NjVH4jvBATYPA +# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-05-02 14:50:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:q4amPCWRoWMThnRa/n/y1w 1; diff --git a/src/root/edit-jobset.tt b/src/root/edit-jobset.tt index b8393f18..734d70ab 100644 --- a/src/root/edit-jobset.tt +++ b/src/root/edit-jobset.tt @@ -83,6 +83,17 @@ +
+ +
+
+ jobset.checkinterval) %]> + sec +
+ (0 to disable polling) +
+
+