Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
56a1ac4d
Commit
56a1ac4d
authored
Aug 21, 2015
by
Dan Poltawski
Browse files
MDL-51109 task: more debug info for failed scheduled tasks
parent
f6609089
Changes
2
Hide whitespace changes
Inline
Side-by-side
admin/tool/task/cli/schedule_task.php
View file @
56a1ac4d
...
...
@@ -149,6 +149,14 @@ if ($execute = $options['execute']) {
mtrace
(
"... used "
.
(
$DB
->
perf_get_queries
()
-
$predbqueries
)
.
" dbqueries"
);
mtrace
(
"... used "
.
(
microtime
(
true
)
-
$pretime
)
.
" seconds"
);
mtrace
(
"Task failed: "
.
$e
->
getMessage
());
if
(
$CFG
->
debugdeveloper
)
{
if
(
!
empty
(
$e
->
debuginfo
))
{
mtrace
(
"Debug info:"
);
mtrace
(
$e
->
debuginfo
);
}
mtrace
(
"Backtrace:"
);
mtrace
(
format_backtrace
(
$e
->
getTrace
(),
true
));
}
\
core\task\manager
::
scheduled_task_failed
(
$task
);
get_mailer
(
'close'
);
exit
(
1
);
...
...
lib/cronlib.php
View file @
56a1ac4d
...
...
@@ -91,6 +91,14 @@ function cron_run() {
mtrace
(
"... used "
.
(
microtime
(
1
)
-
$pretime
)
.
" seconds"
);
}
mtrace
(
"Scheduled task failed: "
.
$task
->
get_name
()
.
","
.
$e
->
getMessage
());
if
(
$CFG
->
debugdeveloper
)
{
if
(
!
empty
(
$e
->
debuginfo
))
{
mtrace
(
"Debug info:"
);
mtrace
(
$e
->
debuginfo
);
}
mtrace
(
"Backtrace:"
);
mtrace
(
format_backtrace
(
$e
->
getTrace
(),
true
));
}
\
core\task\manager
::
scheduled_task_failed
(
$task
);
}
get_mailer
(
'close'
);
...
...
@@ -127,6 +135,14 @@ function cron_run() {
mtrace
(
"... used "
.
(
microtime
(
1
)
-
$pretime
)
.
" seconds"
);
}
mtrace
(
"Adhoc task failed: "
.
get_class
(
$task
)
.
","
.
$e
->
getMessage
());
if
(
$CFG
->
debugdeveloper
)
{
if
(
!
empty
(
$e
->
debuginfo
))
{
mtrace
(
"Debug info:"
);
mtrace
(
$e
->
debuginfo
);
}
mtrace
(
"Backtrace:"
);
mtrace
(
format_backtrace
(
$e
->
getTrace
(),
true
));
}
\
core\task\manager
::
adhoc_task_failed
(
$task
);
}
get_mailer
(
'close'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment