Fixing issue discovered by tests.

This commit is contained in:
mike12345567 2022-10-21 16:02:13 +01:00
parent 4716eaaab5
commit 1e190886fb
2 changed files with 13 additions and 5 deletions

View File

@ -22,7 +22,7 @@ export function createQueue<T>(
): BullQueue.Queue<T> {
const queueConfig: any = redisProtocolUrl || { redis: opts }
let queue: any
if (env.isTest()) {
if (!env.isTest()) {
queue = new BullQueue(jobQueue, queueConfig)
} else {
queue = new InMemoryQueue(jobQueue, queueConfig)

View File

@ -20,6 +20,7 @@ import {
import { events } from "@budibase/backend-core"
import { backups } from "@budibase/pro"
import { AppBackupTrigger } from "@budibase/types"
import env from "../../../environment"
// the max time we can wait for an invalidation to complete before considering it failed
const MAX_PENDING_TIME_MS = 30 * 60000
@ -107,10 +108,17 @@ async function deployApp(deployment: any, userId: string) {
const devAppId = getDevelopmentAppID(appId)
const productionAppId = getProdAppID(appId)
// trigger backup initially
await backups.triggerAppBackup(productionAppId, AppBackupTrigger.PUBLISH, {
createdBy: userId,
})
// can't do this in test
if (!env.isTest()) {
// trigger backup initially
await backups.triggerAppBackup(
productionAppId,
AppBackupTrigger.PUBLISH,
{
createdBy: userId,
}
)
}
const config: any = {
source: devAppId,