This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
Foodloop-Server/lib/Pear/LocalLoop/Command/recalc_leaderboards.pm

29 lines
482 B
Perl
Raw Permalink Normal View History

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 {
2021-03-20 12:09:50 +00:00
my ( $self, @args ) = @_;
2021-03-20 12:09:50 +00:00
my $leaderboard_rs = $self->app->schema->resultset('Leaderboard');
2021-03-20 12:09:50 +00:00
$leaderboard_rs->recalculate_all;
2021-03-20 23:26:52 +00:00
2021-03-20 15:02:00 +00:00
return 1;
}
=head1 SYNOPSIS
Usage: APPLICATION recalc_leaderboards
Recalculates ALL leaderboards.
=cut
1;