mirror of
https://github.com/derf/travelynx
synced 2025-03-01 21:57:10 +00:00
Proactively recompute yearly stats to avoid long user wait times
This commit is contained in:
parent
e68043b8fb
commit
7486920a6a
1 changed files with 11 additions and 0 deletions
|
@ -125,6 +125,17 @@ sub run {
|
||||||
|
|
||||||
eval { }
|
eval { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Computing yearly stats may take a while, but we've got all time in the
|
||||||
|
# world here. This means users won't have to wait when loading their
|
||||||
|
# own by-year journey log.
|
||||||
|
for my $user ( $db->select( 'users', 'id', { status => 1 } )->hashes->each )
|
||||||
|
{
|
||||||
|
$self->app->get_journey_stats(
|
||||||
|
uid => $user->{id},
|
||||||
|
year => $now->year
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue