Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Cron/LongJobChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function execute()
foreach ($jobs as $job) {
$pid = $job->getPid();

$finished_at = strftime('%Y-%m-%d %H:%M:%S', $this->dateTime->gmtTimestamp());
$finished_at = date('Y-m-d H:i:s', $this->dateTime->gmtTimestamp());
if (function_exists('posix_getsid') && posix_getsid($pid) === false) {
$job->setData('status', \Magento\Cron\Model\Schedule::STATUS_ERROR);
$job->setData('messages', __('Execution stopped due to some error.'));
Expand Down
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Schedule/MassKill.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function execute()
if (function_exists('posix_getsid') && posix_getsid($pid) === false) {
$errorScheduleIds[] = $scheduleId;
} else {
$finished_at = strftime('%Y-%m-%d %H:%M:%S', $this->dateTime->gmtTimestamp());
$finished_at = date('Y-m-d H:i:s', $this->dateTime->gmtTimestamp());
$dbrunningjobs->setData('status', self::STATUS_KILLED);
$dbrunningjobs->setData('messages', __('It is killed by admin.'));
$dbrunningjobs->setData('finished_at', $finished_at);
Expand Down
2 changes: 1 addition & 1 deletion Helper/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function filterTimeInput($time)
$matches = [];
preg_match('/(\d+-\d+-\d+)T(\d+:\d+)/', $time, $matches);
$time = $matches[1] . " " . $matches[2];
return strftime('%Y-%m-%d %H:%M:00', strtotime($time));
return date('Y-m-d H:i:s:00', strtotime($time));
}

/**
Expand Down
6 changes: 3 additions & 3 deletions Observer/ProcessCronQueueObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ protected function _runJob($scheduledTime, $currentTime, $jobConfig, $schedule,
);
}

$schedule->setExecutedAt(strftime('%Y-%m-%d %H:%M:%S', $this->dateTime->gmtTimestamp()))->save();
$schedule->setExecutedAt(date('Y-m-d H:i:s', $this->dateTime->gmtTimestamp()))->save();

$this->startProfiling();
try {
Expand Down Expand Up @@ -176,8 +176,8 @@ protected function _runJob($scheduledTime, $currentTime, $jobConfig, $schedule,
$schedule->setStatus(
Schedule::STATUS_SUCCESS
)->setFinishedAt(
strftime(
'%Y-%m-%d %H:%M:%S',
date(
'Y-m-d H:i:s',
$this->dateTime->gmtTimestamp()
)
);
Expand Down
6 changes: 1 addition & 5 deletions Ui/DataProvider/JobProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,7 @@ public function getData()
$sortField = $this->sortField;
$sortDir = $this->sortDir;
usort($data, function ($a, $b) use ($sortField, $sortDir) {
if ($sortDir == "asc") {
return $a[$sortField] > $b[$sortField];
} else {
return $a[$sortField] < $b[$sortField];
}
return ($a[$sortField] <=> $b[$sortField]) * ($sortDir == 'desc' ? -1 : 1);
});

#filters
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "kiwicommerce/module-cron-scheduler",
"description": "Easily set up and manage cron jobs from the backend with a beautiful and managed timeline feature. Find the actual load on CPU/Memory by cron job execution.",
"type": "magento2-module",
"version": "1.0.8",
"version": "1.0.9",
"license": [
"OSL-3.0"
],
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="KiwiCommerce_CronScheduler" setup_version="1.0.8" active="true">
<module name="KiwiCommerce_CronScheduler" setup_version="1.0.9" active="true">
<sequence>
<module name="Magento_Cron"/>
</sequence>
Expand Down