imports/vx/server/code/vxapp.js
/**
     * Deploy all functions. Each tenant has their own function anchor, so we must
     * iterate over the tenants to create the anchors and deploy the functions.
     */
Deploy all functions. Each tenant has their own function anchor, so we must
iterate over the tenants to create the anchors and deploy the functions.
Deploy all functions . Each tenant has their own function anchor so we must iterate over the tenants to create the anchors and deploy the functions .
deployAllFunctions() {
        Tenants.find( { dateRetired: { $exists: false } }).forEach(tenant => {
            if (!tenant.functionAnchor) {
                OLog.debug(`vxapp.js deployAllFunctions tenant ${tenant.name} does not have a function anchor ` +
                    "no functions will be deployed on their behalf")
                return
            }
            Domains.find( { dateRetired : { $exists: false }, tenant: tenant._id }).forEach(domain => {
                const functionAnchor = VXApp.functionAnchorForDomain(domain._id)
                const qualifiedFunctionAnchor = VXApp.qualifiedFunctionAnchor(functionAnchor, domain._id)
                const fullyQualifiedFunctionAnchor = VXApp.fullyQualifiedFunctionAnchor(qualifiedFunctionAnchor)
                OLog.debug(`vxapp.js deployAllFunctions *instantiating* ${fullyQualifiedFunctionAnchor}`)
                FunctionAnchors[qualifiedFunctionAnchor] = {}
                Functions.find({ dateRetired : { $exists: false }, domain: domain._id }).forEach(funktion => {
                    VXApp.deployFunction(funktion._id)
                })
            })
        })
    }
deployAllFunctions ( ) { Tenants . find ( { dateRetired : { $exists : false } } ) . forEach ( tenant => { if ( ! tenant . functionAnchor ) { OLog . debug ( ` ${ tenant . name } ` + "no functions will be deployed on their behalf" ) return } Domains . find ( { dateRetired : { $exists : false } , tenant : tenant . _id } ) . forEach ( domain => { const functionAnchor = VXApp . functionAnchorForDomain ( domain . _id ) const qualifiedFunctionAnchor = VXApp . qualifiedFunctionAnchor ( functionAnchor , domain . _id ) const fullyQualifiedFunctionAnchor = VXApp . fullyQualifiedFunctionAnchor ( qualifiedFunctionAnchor ) OLog . debug ( ` ${ fullyQualifiedFunctionAnchor } ` ) FunctionAnchors [ qualifiedFunctionAnchor ] = { } Functions . find ( { dateRetired : { $exists : false } , domain : domain . _id } ) . forEach ( funktion => { VXApp . deployFunction ( funktion . _id ) } ) } ) } ) }
Deploy all functions.
Deploy all functions .