Skip to content

Commit f29cbbd

Browse files
committed
add task loader execution time log
1 parent 30603e8 commit f29cbbd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Jenner/Crontab/Daemon.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ public function start()
7070
// add task loader timer is exists.
7171
if (!empty($this->task_loader) && is_callable($this->task_loader)) {
7272
$loop->addPeriodicTimer(60, function () {
73+
$start_time = time();
7374
$this->task_loader = call_user_func($this->task_loader);
75+
$execution_time = time() - $start_time;
76+
if ($execution_time > 60) {
77+
$this->logger->warning("task loader's execution time is more than 60 seconds.");
78+
}
7479
});
7580
}
7681

0 commit comments

Comments
 (0)