Fix retrying uploads by using Octokit retry plugin.

This commit is contained in:
Chris Gavin 2020-09-21 11:06:21 +01:00
parent e67ba57e65
commit 31c2eca167
No known key found for this signature in database
GPG key ID: 07F950B80C27E4DA
118 changed files with 19025 additions and 117 deletions

39
node_modules/bottleneck/src/Batcher.coffee generated vendored Normal file
View file

@ -0,0 +1,39 @@
parser = require "./parser"
Events = require "./Events"
class Batcher
defaults:
maxTime: null
maxSize: null
Promise: Promise
constructor: (@options={}) ->
parser.load @options, @defaults, @
@Events = new Events @
@_arr = []
@_resetPromise()
@_lastFlush = Date.now()
_resetPromise: ->
@_promise = new @Promise (res, rej) => @_resolve = res
_flush: ->
clearTimeout @_timeout
@_lastFlush = Date.now()
@_resolve()
@Events.trigger "batch", @_arr
@_arr = []
@_resetPromise()
add: (data) ->
@_arr.push data
ret = @_promise
if @_arr.length == @maxSize
@_flush()
else if @maxTime? and @_arr.length == 1
@_timeout = setTimeout =>
@_flush()
, @maxTime
ret
module.exports = Batcher