import * as retry from 'p-retry' ; import { IActionContext } from 'vscode-azureextensionui' ; import { ext } from '../extensionVariables' ; import { localize } from '../localize' ; import { ParsedSite } from '../SiteClient' ; import { delay } from '../utils/delay' ; export async function syncTriggersPostDeploy ( context , site ) { await delay ( 10 * 1000 ) ; const retries = 5 ; const client = await site . createClient ( context ) ; await retry ( async ( currentAttempt ) => { const message = currentAttempt === 1 ? localize ( 'syncingTriggers' , 'Syncing triggers...' ) : localize ( 'syncingTriggersAttempt' , 'Syncing triggers (Attempt {0}/{1})...' , currentAttempt , retries + 1 ) ; ext . outputChannel . appendLog ( message , { resourceName : site . fullName } ) ; await client . syncFunctionTriggers ( ) ; } , { retries , minTimeout : 5 * 1000 } ) ; }