Fixing issue discovered by tests.

This commit is contained in:
mike12345567 2022-10-21 16:02:13 +01:00
parent 854cb23947
commit 2a2f41a861
2 changed files with 13 additions and 5 deletions

View File

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

View File

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