Convert variable names to camel case

[MAILPOET-1796]
This commit is contained in:
Jan Jakeš
2020-01-09 15:02:58 +01:00
committed by Jan Jakeš
parent f5da704106
commit 54549ff037
687 changed files with 15890 additions and 15887 deletions

View File

@@ -14,26 +14,26 @@ class CronWorkerScheduler {
$this->wp = $wp;
}
public function schedule($task_type, $next_run_date) {
$already_scheduled = ScheduledTask::where('type', $task_type)
public function schedule($taskType, $nextRunDate) {
$alreadyScheduled = ScheduledTask::where('type', $taskType)
->whereNull('deleted_at')
->where('status', ScheduledTask::STATUS_SCHEDULED)
->findMany();
if ($already_scheduled) {
if ($alreadyScheduled) {
return false;
}
$task = ScheduledTask::create();
$task->type = $task_type;
$task->type = $taskType;
$task->status = ScheduledTask::STATUS_SCHEDULED;
$task->priority = ScheduledTask::PRIORITY_LOW;
$task->scheduled_at = $next_run_date;
$task->scheduledAt = $nextRunDate;
$task->save();
return $task;
}
public function reschedule(ScheduledTask $task, $timeout) {
$scheduled_at = Carbon::createFromTimestamp($this->wp->currentTime('timestamp'));
$task->scheduled_at = $scheduled_at->addMinutes($timeout);
$scheduledAt = Carbon::createFromTimestamp($this->wp->currentTime('timestamp'));
$task->scheduledAt = $scheduledAt->addMinutes($timeout);
$task->setExpr('updated_at', 'NOW()');
$task->status = ScheduledTask::STATUS_SCHEDULED;
$task->save();