Merge branch 'master' into cheeks-fixes

This commit is contained in:
Andrew Kingston 2024-06-11 16:23:07 +02:00 committed by GitHub
commit 9da423d141
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 19 additions and 4 deletions

View File

@ -93,15 +93,21 @@ function isApps() {
return environment.SERVICE_TYPE === ServiceType.APPS return environment.SERVICE_TYPE === ServiceType.APPS
} }
function isQA() {
return environment.BUDIBASE_ENVIRONMENT === "QA"
}
const environment = { const environment = {
isTest, isTest,
isJest, isJest,
isDev, isDev,
isWorker, isWorker,
isApps, isApps,
isQA,
isProd: () => { isProd: () => {
return !isDev() return !isDev()
}, },
BUDIBASE_ENVIRONMENT: process.env.BUDIBASE_ENVIRONMENT,
JS_BCRYPT: process.env.JS_BCRYPT, JS_BCRYPT: process.env.JS_BCRYPT,
JWT_SECRET: process.env.JWT_SECRET, JWT_SECRET: process.env.JWT_SECRET,
JWT_SECRET_FALLBACK: process.env.JWT_SECRET_FALLBACK, JWT_SECRET_FALLBACK: process.env.JWT_SECRET_FALLBACK,

View File

@ -25,8 +25,8 @@ export async function getAppMigrationVersion(appId: string): Promise<string> {
let metadata: AppMigrationDoc | undefined = await cache.get(cacheKey) let metadata: AppMigrationDoc | undefined = await cache.get(cacheKey)
// We don't want to cache in dev, in order to be able to tweak it // We don't want to cache in dev or QA, in order to be able to tweak it
if (metadata && !env.isDev()) { if (metadata && !env.isDev() && !env.isQA()) {
return metadata.version return metadata.version
} }

View File

@ -72,7 +72,11 @@ export async function startup(
printFeatures() printFeatures()
STARTUP_RAN = true STARTUP_RAN = true
if (app && server && !env.CLUSTER_MODE) { if (app && server && !env.CLUSTER_MODE) {
console.log(`Budibase running on ${JSON.stringify(server.address())}`) let startupLog = `Budibase running on ${JSON.stringify(server.address())}`
if (env.BUDIBASE_ENVIRONMENT) {
startupLog = `${startupLog} - environment: "${env.BUDIBASE_ENVIRONMENT}"`
}
console.log(startupLog)
const address = server.address() as AddressInfo const address = server.address() as AddressInfo
env._set("PORT", address.port) env._set("PORT", address.port)
} }

View File

@ -46,6 +46,7 @@ const environment = {
SMTP_FALLBACK_ENABLED: process.env.SMTP_FALLBACK_ENABLED, SMTP_FALLBACK_ENABLED: process.env.SMTP_FALLBACK_ENABLED,
DISABLE_DEVELOPER_LICENSE: process.env.DISABLE_DEVELOPER_LICENSE, DISABLE_DEVELOPER_LICENSE: process.env.DISABLE_DEVELOPER_LICENSE,
SQS_SEARCH_ENABLE: process.env.SQS_SEARCH_ENABLE, SQS_SEARCH_ENABLE: process.env.SQS_SEARCH_ENABLE,
BUDIBASE_ENVIRONMENT: process.env.BUDIBASE_ENVIRONMENT,
// smtp // smtp
SMTP_USER: process.env.SMTP_USER, SMTP_USER: process.env.SMTP_USER,
SMTP_PASSWORD: process.env.SMTP_PASSWORD, SMTP_PASSWORD: process.env.SMTP_PASSWORD,

View File

@ -88,7 +88,11 @@ const shutdown = () => {
} }
export default server.listen(parseInt(env.PORT || "4002"), async () => { export default server.listen(parseInt(env.PORT || "4002"), async () => {
console.log(`Worker running on ${JSON.stringify(server.address())}`) let startupLog = `Worker running on ${JSON.stringify(server.address())}`
if (env.BUDIBASE_ENVIRONMENT) {
startupLog = `${startupLog} - environment: "${env.BUDIBASE_ENVIRONMENT}"`
}
console.log(startupLog)
await initPro() await initPro()
await redis.clients.init() await redis.clients.init()
cache.docWritethrough.init() cache.docWritethrough.init()