@@ -393,13 +393,14 @@ export const evernoteConnector: ConnectorConfig = {
393393 syncContext ?: Record < string , unknown >
394394 ) : Promise < ExternalDocumentList > => {
395395 const notebookGuid = ( sourceConfig . notebookGuid as string ) || undefined
396+ const retryOptions = { maxRetries : 3 , initialDelayMs : 500 }
396397
397398 if ( syncContext && ! syncContext . tagMap ) {
398- const tags = await apiListTags ( accessToken )
399+ const tags = await apiListTags ( accessToken , retryOptions )
399400 syncContext . tagMap = Object . fromEntries ( tags . map ( ( t ) => [ t . guid , t . name ] ) )
400401 }
401402 if ( syncContext && ! syncContext . notebookMap ) {
402- const notebooks = await apiListNotebooks ( accessToken )
403+ const notebooks = await apiListNotebooks ( accessToken , retryOptions )
403404 syncContext . notebookMap = Object . fromEntries ( notebooks . map ( ( nb ) => [ nb . guid , nb . name ] ) )
404405 }
405406
@@ -412,7 +413,6 @@ export const evernoteConnector: ConnectorConfig = {
412413
413414 logger . info ( 'Listing Evernote notes' , { offset, maxNotes : NOTES_PER_PAGE } )
414415
415- const retryOptions = { maxRetries : 3 , initialDelayMs : 500 }
416416 const result = await apiFindNotesMetadata (
417417 accessToken ,
418418 offset ,
@@ -468,11 +468,11 @@ export const evernoteConnector: ConnectorConfig = {
468468 const host = getHost ( accessToken )
469469
470470 if ( syncContext && ! syncContext . tagMap ) {
471- const tags = await apiListTags ( accessToken )
471+ const tags = await apiListTags ( accessToken , retryOptions )
472472 syncContext . tagMap = Object . fromEntries ( tags . map ( ( t ) => [ t . guid , t . name ] ) )
473473 }
474474 if ( syncContext && ! syncContext . notebookMap ) {
475- const notebooks = await apiListNotebooks ( accessToken )
475+ const notebooks = await apiListNotebooks ( accessToken , retryOptions )
476476 syncContext . notebookMap = Object . fromEntries ( notebooks . map ( ( nb ) => [ nb . guid , nb . name ] ) )
477477 }
478478
@@ -482,9 +482,9 @@ export const evernoteConnector: ConnectorConfig = {
482482 tagMap = syncContext . tagMap as Record < string , string >
483483 notebookMap = syncContext . notebookMap as Record < string , string >
484484 } else {
485- const tags = await apiListTags ( accessToken )
485+ const tags = await apiListTags ( accessToken , retryOptions )
486486 tagMap = Object . fromEntries ( tags . map ( ( t ) => [ t . guid , t . name ] ) )
487- const notebooks = await apiListNotebooks ( accessToken )
487+ const notebooks = await apiListNotebooks ( accessToken , retryOptions )
488488 notebookMap = Object . fromEntries ( notebooks . map ( ( nb ) => [ nb . guid , nb . name ] ) )
489489 }
490490
0 commit comments