feat: add developer inactivity alerts#4868
Conversation
| $schedule->command(UpdateBeatenGamesLeaderboard::class)->everyFiveMinutes(); | ||
|
|
||
| $schedule->command(UpdatePlayerPointsStats::class, ['--existing-only'])->hourly(); | ||
| $schedule->command(UpdateSearchIndexForQueuedEntities::class)->hourly(); | ||
| $schedule->command(ProcessExpiringClaims::class)->hourly(); | ||
|
|
||
| $schedule->command(UpdateAwardsStaticData::class)->everyFourHours(); | ||
|
|
||
| $schedule->command(PruneGameRecentPlayers::class)->daily(); | ||
| $schedule->command(DeleteStalePlayerPointsStatsEntries::class)->weekly(); | ||
| $schedule->command(CheckDeveloperInactivity::class)->daily(); | ||
| $schedule->command(CheckForAchievementSetChanges::class)->daily(); | ||
|
|
||
| if (app()->environment() === 'production') { | ||
| $schedule->command(UpdateAwardsStaticData::class)->everyFourHours(); | ||
| $schedule->command(UpdateBeatenGamesLeaderboard::class)->everyFiveMinutes(); | ||
| $schedule->command(UpdatePlayerPointsStats::class, ['--existing-only'])->hourly(); | ||
| $schedule->command(ProcessExpiringClaims::class)->hourly(); | ||
| $schedule->command(UpdateDeveloperContributionYield::class)->weeklyOn(2, '10:00'); // Tuesdays at 10AM UTC | ||
| $schedule->command(CrawlPlayerWeightedPoints::class)->weeklyOn(3, '10:00'); // Wednesdays at 10AM UTC | ||
| $schedule->command(CheckForAchievementSetChanges::class)->daily(); | ||
| } | ||
| $schedule->command(DeleteStalePlayerPointsStatsEntries::class)->weekly(); | ||
| $schedule->command(UpdateDeveloperContributionYield::class)->weeklyOn(2, '10:00'); // Tuesdays at 10AM UTC | ||
| $schedule->command(CrawlPlayerWeightedPoints::class)->weeklyOn(3, '10:00'); // Wednesdays at 10AM UTC |
There was a problem hiding this comment.
Sorted these around and removed the production conditional on several of them (no longer needed now that we have a dedicated stage server).
There was a problem hiding this comment.
I assumed the environment check was so they don't run in the local environment. I hadn't really considered not wanting to run them in stage.
There was a problem hiding this comment.
Yep, purely here as a guard against stage.
These shouldn't ever run locally. On our app server, we have a cron that runs every 60 seconds:
php artisan schedule:run
This Laravel built-in command checks if there are any scheduled commands that are due for execution and executes what's ready to go.
| $schedule->command(UpdateBeatenGamesLeaderboard::class)->everyFiveMinutes(); | ||
|
|
||
| $schedule->command(UpdatePlayerPointsStats::class, ['--existing-only'])->hourly(); | ||
| $schedule->command(UpdateSearchIndexForQueuedEntities::class)->hourly(); | ||
| $schedule->command(ProcessExpiringClaims::class)->hourly(); | ||
|
|
||
| $schedule->command(UpdateAwardsStaticData::class)->everyFourHours(); | ||
|
|
||
| $schedule->command(PruneGameRecentPlayers::class)->daily(); | ||
| $schedule->command(DeleteStalePlayerPointsStatsEntries::class)->weekly(); | ||
| $schedule->command(CheckDeveloperInactivity::class)->daily(); | ||
| $schedule->command(CheckForAchievementSetChanges::class)->daily(); | ||
|
|
||
| if (app()->environment() === 'production') { | ||
| $schedule->command(UpdateAwardsStaticData::class)->everyFourHours(); | ||
| $schedule->command(UpdateBeatenGamesLeaderboard::class)->everyFiveMinutes(); | ||
| $schedule->command(UpdatePlayerPointsStats::class, ['--existing-only'])->hourly(); | ||
| $schedule->command(ProcessExpiringClaims::class)->hourly(); | ||
| $schedule->command(UpdateDeveloperContributionYield::class)->weeklyOn(2, '10:00'); // Tuesdays at 10AM UTC | ||
| $schedule->command(CrawlPlayerWeightedPoints::class)->weeklyOn(3, '10:00'); // Wednesdays at 10AM UTC | ||
| $schedule->command(CheckForAchievementSetChanges::class)->daily(); | ||
| } | ||
| $schedule->command(DeleteStalePlayerPointsStatsEntries::class)->weekly(); | ||
| $schedule->command(UpdateDeveloperContributionYield::class)->weeklyOn(2, '10:00'); // Tuesdays at 10AM UTC | ||
| $schedule->command(CrawlPlayerWeightedPoints::class)->weeklyOn(3, '10:00'); // Wednesdays at 10AM UTC |
There was a problem hiding this comment.
I assumed the environment check was so they don't run in the local environment. I hadn't really considered not wanting to run them in stage.
https://discord.com/channels/476211979464343552/1002688331827658774/1498772708413149294
This PR adds support for surfacing developer inactivity alerts into a Discord feed channel. Users with a junior developer, moderator, or admin role are excluded from this check.
The alert checks for:
users.last_updated_at)If the developer is site-inactive for 3 months, an alert will surface. If the developer doesn't have any of the above activities recorded for 6 months, an alert will surface.
The alerts are driven by a nightly scheduled command. Results are cached in Redis so the same alert doesn't pop multiple times.