Merge pull request #3 from henrywhitaker3/dev-v1

Fixed scheduling issue
This commit is contained in:
Henry Whitaker
2020-04-09 09:03:08 +01:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Console; namespace App\Console;
use App\Helpers\SpeedtestHelper; use App\Helpers\SpeedtestHelper;
use App\Jobs\SpeedtestJob;
use Illuminate\Console\Scheduling\Schedule; use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
@@ -26,8 +27,8 @@ class Kernel extends ConsoleKernel
protected function schedule(Schedule $schedule) protected function schedule(Schedule $schedule)
{ {
$schedule->call(function() { $schedule->call(function() {
SpeedtestHelper::runSpeedtest(); SpeedtestJob::dispatch();
})->hourly(); })->hourlyAt(0);
} }
/** /**

View File

@@ -120,8 +120,8 @@ export default class HistoryGraph extends Component {
duData.datasets[0].data.push(download); duData.datasets[0].data.push(download);
duData.datasets[1].data.push(upload); duData.datasets[1].data.push(upload);
pingData.datasets[0].data.push(ping); pingData.datasets[0].data.push(ping);
duData.labels.push(new Date(e.created_at).toLocaleDateString()); duData.labels.push(new Date(e.created_at).toLocaleString());
pingData.labels.push(new Date(e.created_at).toLocaleDateString()); pingData.labels.push(new Date(e.created_at).toLocaleString());
}); });
this.setState({ this.setState({