Browse Source

Linting and fixing an issue with the dev pass through.

pull/4023/head
mike12345567 5 years ago
parent
commit
7e6f215598
  1. 5
      packages/auth/src/redis/index.js
  2. 9
      packages/server/src/api/controllers/dev.js
  3. 9
      packages/worker/src/api/controllers/admin/configs.js

5
packages/auth/src/redis/index.js

@ -4,17 +4,12 @@ const Redis = env.isTest() ? require("ioredis-mock") : require("ioredis")
const { addDbPrefix, removeDbPrefix, getRedisOptions } = require("./utils")
const RETRY_PERIOD_MS = 2000
const MAX_RETRIES = 20
const CLUSTERED = false
// for testing just generate the client once
let CONNECTED = false
let CLIENT = env.isTest() ? new Redis(getRedisOptions()) : null
function retryConnection() {
setTimeout(init, RETRY_PERIOD_MS)
}
/**
* Inits the system, will error if unable to connect to redis cluster (may take up to 10 seconds) otherwise
* will return the ioredis client which will be ready to use.

9
packages/server/src/api/controllers/dev.js

@ -23,7 +23,16 @@ async function redirect(ctx, method) {
if (cookie) {
ctx.set("set-cookie", cookie)
}
let body
try {
body = await response.json()
} catch (err) {
// don't worry about errors, likely no JSON
}
ctx.status = response.status
if (body) {
ctx.body = body
}
ctx.cookies
}

9
packages/worker/src/api/controllers/admin/configs.js

@ -6,10 +6,8 @@ const {
getGlobalUserParams,
getScopedFullConfig,
} = require("@budibase/auth").db
const fetch = require("node-fetch")
const { Configs } = require("../../../constants")
const email = require("../../../utilities/email")
const env = require("../../../environment")
const { upload, ObjectStoreBuckets } = require("@budibase/auth").objectStore
const APP_PREFIX = "app_"
@ -155,12 +153,7 @@ exports.configChecklist = async function (ctx) {
// TODO: Watch get started video
// Apps exist
let allDbs
if (env.COUCH_DB_URL) {
allDbs = await (await fetch(`${env.COUCH_DB_URL}/_all_dbs`)).json()
} else {
allDbs = await CouchDB.allDbs()
}
let allDbs = await CouchDB.allDbs()
const appDbNames = allDbs.filter(dbName => dbName.startsWith(APP_PREFIX))
// They have set up SMTP

Loading…
Cancel
Save