More logical time handling

This commit is contained in:
Dane Everitt 2018-08-31 21:00:13 -07:00
parent e5636405f3
commit 178b8f8ce6
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 27 additions and 15 deletions

View file

@ -2,7 +2,7 @@
namespace Pterodactyl\Http\Controllers\Server\Tasks;
use Carbon\Carbon;
use Cake\Chronos\Chronos;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Pterodactyl\Http\Controllers\Controller;
@ -11,12 +11,22 @@ use Pterodactyl\Contracts\Repository\ScheduleRepositoryInterface;
class ActionController extends Controller
{
/**
* @var \Pterodactyl\Services\Schedules\ProcessScheduleService
*/
private $processScheduleService;
/**
* @var \Pterodactyl\Contracts\Repository\ScheduleRepositoryInterface
*/
private $repository;
/**
* ActionController constructor.
*
* @param \Pterodactyl\Services\Schedules\ProcessScheduleService $processScheduleService
* @param \Pterodactyl\Contracts\Repository\ScheduleRepositoryInterface $repository
*/
public function __construct(ProcessScheduleService $processScheduleService, ScheduleRepositoryInterface $repository)
{
$this->processScheduleService = $processScheduleService;
@ -61,7 +71,7 @@ class ActionController extends Controller
$server = $request->attributes->get('server');
$this->authorize('toggle-schedule', $server);
$this->processScheduleService->setRunTimeOverride(Carbon::now())->handle(
$this->processScheduleService->setRunTimeOverride(Chronos::now())->handle(
$request->attributes->get('schedule')
);