Enabled recalculation of leaderboards at any point

This commit is contained in:
Tom Bloor 2017-08-21 15:19:39 +01:00
parent 3f743f0b5f
commit 9b9b2bd322
3 changed files with 80 additions and 2 deletions

View file

@ -0,0 +1,26 @@
package Pear::LocalLoop::Command::recalc_leaderboards;
use Mojo::Base 'Mojolicious::Command';
use Mojo::Util 'getopt';
has description => 'Build All leaderboards';
has usage => sub { shift->extract_usage };
sub run {
my ( $self, @args ) = @_;
my $leaderboard_rs = $self->app->schema->resultset('Leaderboard');
$leaderboard_rs->recalculate_all;
}
=head1 SYNOPSIS
Usage: APPLICATION recalc_leaderboards
Recalculates ALL leaderboards.
=cut
1;