Skip to content

Commit

Permalink
Move scheduled commands to routes/console.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ilumos committed Sep 8, 2024
1 parent 5a14996 commit 861e68f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 59 deletions.
54 changes: 0 additions & 54 deletions app/Console/Kernel.php

This file was deleted.

32 changes: 27 additions & 5 deletions routes/console.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php

use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Schedule;
use Zeropingheroes\Lanager\Console\Commands\UpdateSteamApps;
use Zeropingheroes\Lanager\Console\Commands\UpdateSteamAppsMetadata;
use Zeropingheroes\Lanager\Console\Commands\UpdateSteamUserApps;
use Zeropingheroes\Lanager\Console\Commands\UpdateSteamUsers;

/*
|--------------------------------------------------------------------------
Expand All @@ -14,6 +17,25 @@
|
*/

Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
// Steam limit API calls to 100,000 per day
// the below schedules will not exceed this limit for a LAN party of ~1,000 users.

// 1 Steam API call per 100 users
// e.g. for 1000 users:
// 10 calls each minute * 1440 minutes in a day = 14,400 daily API calls
Schedule::command(UpdateSteamUsers::class)
->everyMinute();

// 1 Steam API call per user
// e.g. for 1000 users:
// 1000 calls * 48 half-ours in a day = 48,000 daily API calls
Schedule::command(UpdateSteamUserApps::class)
->everyThirtyMinutes();

// 1 Steam API call total
Schedule::command(UpdateSteamApps::class)
->hourly();

// Many rate-limited Steam API calls
Schedule::command(UpdateSteamAppsMetadata::class)
->dailyAt('07:00');

0 comments on commit 861e68f

Please sign in to comment.