mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-03 02:52:37 +00:00
report timeout errors to sentry
This commit is contained in:
parent
560919b78f
commit
887423f8d7
1 changed files with 7 additions and 3 deletions
|
@ -7,6 +7,8 @@ define [
|
||||||
|
|
||||||
class PDFRenderer
|
class PDFRenderer
|
||||||
JOB_QUEUE_INTERVAL: 25
|
JOB_QUEUE_INTERVAL: 25
|
||||||
|
PAGE_LOAD_TIMEOUT: 30*1000
|
||||||
|
PAGE_RENDER_TIMEOUT: 30*1000
|
||||||
|
|
||||||
constructor: (@url, @options) ->
|
constructor: (@url, @options) ->
|
||||||
PDFJS.disableFontFace = true # avoids repaints, uses worker more
|
PDFJS.disableFontFace = true # avoids repaints, uses worker more
|
||||||
|
@ -131,13 +133,14 @@ define [
|
||||||
|
|
||||||
timedOut = false
|
timedOut = false
|
||||||
timer = $timeout () =>
|
timer = $timeout () =>
|
||||||
|
Raven.captureMessage?('pdfng page load timed out after ' + @PAGE_LOAD_TIMEOUT + 'ms')
|
||||||
# console.log 'page load timed out', pagenum
|
# console.log 'page load timed out', pagenum
|
||||||
timedOut = true
|
timedOut = true
|
||||||
@spinner.stop(element.canvas)
|
@spinner.stop(element.canvas)
|
||||||
# @jobs = @jobs - 1
|
# @jobs = @jobs - 1
|
||||||
# @triggerRenderQueue(0)
|
# @triggerRenderQueue(0)
|
||||||
this.errorCallback?('timeout')
|
this.errorCallback?('timeout')
|
||||||
, 30*1000
|
, @PAGE_LOAD_TIMEOUT
|
||||||
|
|
||||||
@pageLoad[pagenum] = @getPage(pagenum)
|
@pageLoad[pagenum] = @getPage(pagenum)
|
||||||
|
|
||||||
|
@ -221,11 +224,12 @@ define [
|
||||||
|
|
||||||
timedOut = false
|
timedOut = false
|
||||||
|
|
||||||
timer = $timeout () ->
|
timer = $timeout () =>
|
||||||
|
Raven.captureMessage?('pdfng page render timed out after ' + @PAGE_RENDER_TIMEOUT + 'ms')
|
||||||
# console.log 'page render timed out', pagenum
|
# console.log 'page render timed out', pagenum
|
||||||
timedOut = true
|
timedOut = true
|
||||||
result.cancel()
|
result.cancel()
|
||||||
, 30*1000
|
, @PAGE_RENDER_TIMEOUT
|
||||||
|
|
||||||
result.then () ->
|
result.then () ->
|
||||||
# console.log 'page rendered', pagenum
|
# console.log 'page rendered', pagenum
|
||||||
|
|
Loading…
Reference in a new issue