Skip to content

Commit

Permalink
fix problems mentioned in review of PR#323
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Apr 7, 2015
1 parent 3552e71 commit c44e9cf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/OpenQA/Plugin/Gru.pm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ sub register {
}

sub add_task {
($_[0]->{tasks}->{$_[1]} = $_[2]) and return $_[0];
my ($self, $taskname, $coderef) = @_;

$self->{tasks}->{$taskname} = $coderef;
}

sub schema {
Expand All @@ -72,8 +74,8 @@ sub enqueue {
package OpenQA::Plugin::Gru::Command::gru;
use Mojo::Base 'Mojolicious::Command';

has usage => "usage: $0 gru\n";
has description => 'Run a gru to process jobs';
has usage => "usage: $0 gru [-o]\n";
has description => 'Run a gru to process jobs - give -o to exit _o_nce everything is done';

sub cmd_list {
my ($self) = @_;
Expand Down
1 change: 1 addition & 0 deletions lib/OpenQA/Schema/Result/Assets.pm
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ sub ensure_size {
return $size;
}

# this is a GRU task - abusing the namespace
sub limit_assets {
my ($app) = @_;
my $groups = $app->db->resultset('JobGroups')->search({}, { select => 'id' });
Expand Down
1 change: 1 addition & 0 deletions lib/OpenQA/Schema/Result/GruTasks.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package OpenQA::Schema::Result::GruTasks;
use base qw/DBIx::Class::Core/;

use JSON;
use db_helpers;

__PACKAGE__->table('gru_tasks');
Expand Down

0 comments on commit c44e9cf

Please sign in to comment.