build/src/index.js
/**
     * Given an operation, poll it until complete.
     * @private
     * @param name Fully qualified name of the operation.
     */
Given an operation, poll it until complete.
@private
@param name Fully qualified name of the operation.
Given an operation poll it until complete . @private @param name Fully qualified name of the operation .
async _poll(name) {
        const gcf = await this._getGCFClient();
        const res = await gcf.operations.get({ name });
        const operation = res.data;
        if (operation.error) {
            const message = JSON.stringify(operation.error);
            throw new Error(message);
        }
        if (operation.done) {
            return;
        }
        await new Promise(r => setTimeout(r, 5000));
        await this._poll(name);
    }
async _poll ( name ) { const gcf = await this . _getGCFClient ( ) ; const res = await gcf . operations . get ( { name } ) ; const operation = res . data ; if ( operation . error ) { const message = JSON . stringify ( operation . error ) ; throw new Error ( message ) ; } if ( operation . done ) { return ; } await new Promise ( r => setTimeout ( r , 5000 ) ) ; await this . _poll ( name ) ; }
Given an operation, poll it until complete.
Given an operation poll it until complete .