diff --git a/app/Console/Commands/UpdateMoonPricing.php b/app/Console/Commands/UpdateMoonPricing.php new file mode 100644 index 000000000..2119fd890 --- /dev/null +++ b/app/Console/Commands/UpdateMoonPricing.php @@ -0,0 +1,60 @@ +job_name = 'CorpJournal'; + $job->job_state = 'Starting'; + $job->system_time = $time; + $job->save(); + + $moonCalc = new MoonCalc(); + $moonCalc->FetchNewPrices(); + + //Set the state of the job as finished + DB::table('schedule_jobs')->where('system_time', $time)->update([ + 'job_state' => 'Finished', + ]); + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 910933c38..1c4ff0101 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -16,6 +16,7 @@ class Kernel extends ConsoleKernel Commands\CorpJournal::class, Commands\getCorps::class, Commands\sendMail::class, + Commands\UpdateMoonPricing::class, ]; /** @@ -27,10 +28,13 @@ class Kernel extends ConsoleKernel protected function schedule(Schedule $schedule) { $schedule->command('services:corpjournal') - ->everyHour() + ->hourly() ->withoutOverlapping(); $schedule->command('services:getcorps') - ->everyDay() + ->daily() + ->withoutOverlapping(); + $schedule->command('services:updatemoonprice') + ->hourly() ->withoutOverlapping(); //$schedule->command('services:sendmail') // ->monthlyOn(1, '09:00')