code review
This commit is contained in:
parent
346c4bd406
commit
aef74c937e
|
@ -4,6 +4,7 @@ const AWS = require("aws-sdk")
|
|||
const fetch = require("node-fetch")
|
||||
const { budibaseAppsDir } = require("../../../utilities/budibaseDir")
|
||||
const PouchDB = require("../../../db")
|
||||
const environment = require("../../../environment")
|
||||
|
||||
async function invalidateCDN(cfDistribution, appId) {
|
||||
const cf = new AWS.CloudFront({})
|
||||
|
@ -24,7 +25,7 @@ async function invalidateCDN(cfDistribution, appId) {
|
|||
|
||||
exports.updateDeploymentQuota = async function(quota) {
|
||||
const DEPLOYMENT_SUCCESS_URL =
|
||||
process.env.DEPLOYMENT_CREDENTIALS_URL + "deploy/success"
|
||||
environment.DEPLOYMENT_CREDENTIALS_URL + "deploy/success"
|
||||
|
||||
const response = await fetch(DEPLOYMENT_SUCCESS_URL, {
|
||||
method: "POST",
|
||||
|
|
|
@ -5,6 +5,7 @@ const {
|
|||
verifyDeployment,
|
||||
updateDeploymentQuota,
|
||||
} = require("./aws")
|
||||
const { DocumentTypes } = require("../../../db/utils")
|
||||
|
||||
function replicate(local, remote) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
@ -38,8 +39,12 @@ async function replicateCouch({ instanceId, clientId, credentials }) {
|
|||
async function getCurrentInstanceQuota(instanceId) {
|
||||
const db = new PouchDB(instanceId)
|
||||
const records = await db.allDocs({
|
||||
startkey: "record:",
|
||||
endkey: `record:\ufff0`,
|
||||
startkey: "re:",
|
||||
endkey: `re:\ufff0`,
|
||||
})
|
||||
const users = await db.allDocs({
|
||||
startkey: DocumentTypes.USER + ,
|
||||
endkey: `us:\ufff0`,
|
||||
})
|
||||
const existingRecords = records.rows.length
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@ exports.DocumentTypes = DocumentTypes
|
|||
|
||||
const UNICODE_MAX = "\ufff0"
|
||||
|
||||
exports.UNICODE_MAX = UNICODE_MAX
|
||||
|
||||
/**
|
||||
* If creating DB allDocs/query params with only a single top level ID this can be used, this
|
||||
* is usually the case as most of our docs are top level e.g. models, automations, users and so on.
|
||||
|
|
Loading…
Reference in New Issue