mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-13 11:38:31 +08:00
fix(tasks): Add instrumentation to Task's performLocal
A slow performLocal may be one of the causes of #2725
This commit is contained in:
parent
2af6eb7be3
commit
1b4209ed37
2 changed files with 8 additions and 2 deletions
|
@ -137,7 +137,13 @@ class TaskQueue
|
|||
task.sequentialId = ++@_currentSequentialId
|
||||
|
||||
@_dequeueObsoleteTasks(task)
|
||||
task.runLocal().then =>
|
||||
runLocalStart = Date.now()
|
||||
task.runLocal()
|
||||
.then =>
|
||||
runLocalTime = Date.now() - runLocalStart
|
||||
if runLocalTime >= 150
|
||||
err = new Error("Task peformLocal took more than 150ms")
|
||||
NylasEnv.reportError(err, {task: task.toJSON(), duration: runLocalTime, taskName: task.constructor.name})
|
||||
@_queue.push(task)
|
||||
@_updateSoon()
|
||||
|
||||
|
|
|
@ -278,7 +278,7 @@ class NylasEnvConstructor
|
|||
jasmine.getEnv().currentSpec.fail(error)
|
||||
else if @inDevMode() and not noWindows
|
||||
@openDevTools()
|
||||
@executeJavaScriptInDevTools('DevToolsAPI.showConsole()')
|
||||
@executeJavaScriptInDevTools("DevToolsAPI.showPanel('console')")
|
||||
|
||||
@errorLogger.reportError(error, extra)
|
||||
|
||||
|
|
Loading…
Reference in a new issue