Merge branch 'master' into BUDI-8449/when-return-all-table-rows-is-selected-the-is-in-filter

This commit is contained in:
Adria Navarro 2024-07-11 14:40:40 +02:00 committed by GitHub
commit e3705f1e87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 14 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "2.29.16",
"version": "2.29.17",
"npmClient": "yarn",
"packages": [
"packages/*",

View File

@ -25,7 +25,10 @@ export const getCouchInfo = (connection?: string) => {
}
const authCookie = Buffer.from(`${username}:${password}`).toString("base64")
let sqlUrl = env.COUCH_DB_SQL_URL
if (!sqlUrl && urlInfo.url) {
// default for dev
if (env.isDev() && !sqlUrl) {
sqlUrl = "http://localhost:4006"
} else if (!sqlUrl && urlInfo.url) {
const parsed = new URL(urlInfo.url)
// attempt to connect on default port
sqlUrl = urlInfo.url.replace(parsed.port, "4984")

View File

@ -114,7 +114,7 @@ const environment = {
ENCRYPTION_KEY: process.env.ENCRYPTION_KEY,
API_ENCRYPTION_KEY: getAPIEncryptionKey(),
COUCH_DB_URL: process.env.COUCH_DB_URL || "http://localhost:4005",
COUCH_DB_SQL_URL: process.env.COUCH_DB_SQL_URL || "http://localhost:4006",
COUCH_DB_SQL_URL: process.env.COUCH_DB_SQL_URL,
SQS_SEARCH_ENABLE: process.env.SQS_SEARCH_ENABLE,
SQS_SEARCH_ENABLE_TENANTS:
process.env.SQS_SEARCH_ENABLE_TENANTS?.split(",") || [],

View File

@ -28,7 +28,6 @@ const DEFAULTS = {
PLUGINS_DIR: "/plugins",
FORKED_PROCESS_NAME: "main",
JS_RUNNER_MEMORY_LIMIT: 64,
COUCH_DB_SQL_URL: "http://localhost:4006",
}
const QUERY_THREAD_TIMEOUT =
@ -44,7 +43,7 @@ const environment = {
// important - prefer app port to generic port
PORT: process.env.APP_PORT || process.env.PORT,
COUCH_DB_URL: process.env.COUCH_DB_URL,
COUCH_DB_SQL_URL: process.env.COUCH_DB_SQL_URL || DEFAULTS.COUCH_DB_SQL_URL,
COUCH_DB_SQL_URL: process.env.COUCH_DB_SQL_URL,
MINIO_URL: process.env.MINIO_URL,
WORKER_URL: process.env.WORKER_URL,
AWS_REGION: process.env.AWS_REGION,

View File

@ -1,6 +1,6 @@
import { Ctx, MaintenanceType } from "@budibase/types"
import env from "../../../environment"
import { env as coreEnv } from "@budibase/backend-core"
import { env as coreEnv, db as dbCore } from "@budibase/backend-core"
import nodeFetch from "node-fetch"
let sqsAvailable: boolean
@ -12,7 +12,12 @@ async function isSqsAvailable() {
}
try {
await nodeFetch(coreEnv.COUCH_DB_SQL_URL, {
const couchInfo = dbCore.getCouchInfo()
if (!couchInfo.sqlUrl) {
sqsAvailable = false
return false
}
await nodeFetch(couchInfo.sqlUrl, {
timeout: 1000,
})
sqsAvailable = true