mirror of
https://github.com/tvytlx/ai-agent-deep-dive.git
synced 2026-04-04 16:14:50 +08:00
20 lines
419 B
JavaScript
20 lines
419 B
JavaScript
'use strict'
|
|
const RetryHandler = require('../handler/retry-handler')
|
|
|
|
module.exports = globalOpts => {
|
|
return dispatch => {
|
|
return function retryInterceptor (opts, handler) {
|
|
return dispatch(
|
|
opts,
|
|
new RetryHandler(
|
|
{ ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } },
|
|
{
|
|
handler,
|
|
dispatch
|
|
}
|
|
)
|
|
)
|
|
}
|
|
}
|
|
}
|