Update as per changes to pro SDK.
This commit is contained in:
parent
11f1e95cc0
commit
355cb9c091
|
@ -20,7 +20,7 @@ const {
|
||||||
} = require("@budibase/backend-core/context")
|
} = require("@budibase/backend-core/context")
|
||||||
const { events } = require("@budibase/backend-core")
|
const { events } = require("@budibase/backend-core")
|
||||||
const { app } = require("@budibase/backend-core/cache")
|
const { app } = require("@budibase/backend-core/cache")
|
||||||
const { logs } = require("@budibase/pro")
|
const { automations } = require("@budibase/pro")
|
||||||
const { clearOldHistory } = require("../../automations/logging")
|
const { clearOldHistory } = require("../../automations/logging")
|
||||||
|
|
||||||
const ACTION_DEFS = removeDeprecated(actions.ACTION_DEFINITIONS)
|
const ACTION_DEFS = removeDeprecated(actions.ACTION_DEFINITIONS)
|
||||||
|
@ -198,7 +198,7 @@ exports.logSearch = async function (ctx) {
|
||||||
let { automationId, status, page, startDate } = ctx.request.body
|
let { automationId, status, page, startDate } = ctx.request.body
|
||||||
// before querying logs, make sure old logs are cleared out
|
// before querying logs, make sure old logs are cleared out
|
||||||
await clearOldHistory()
|
await clearOldHistory()
|
||||||
ctx.body = await logs.automations.getLogs(
|
ctx.body = await automations.logs.getLogs(
|
||||||
startDate,
|
startDate,
|
||||||
status,
|
status,
|
||||||
automationId,
|
automationId,
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { Automation } from "../../definitions/common"
|
||||||
import { app } from "@budibase/backend-core/cache"
|
import { app } from "@budibase/backend-core/cache"
|
||||||
import { backOff } from "../../utilities"
|
import { backOff } from "../../utilities"
|
||||||
import * as env from "../../environment"
|
import * as env from "../../environment"
|
||||||
import { logs } from "@budibase/pro"
|
import { automations } from "@budibase/pro"
|
||||||
import { AppMetadataErrors } from "@budibase/types"
|
import { AppMetadataErrors } from "@budibase/types"
|
||||||
import { AutomationResults, AutomationStatus } from "@budibase/types"
|
import { AutomationResults, AutomationStatus } from "@budibase/types"
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ function getStatus(results: AutomationResults) {
|
||||||
export async function clearOldHistory() {
|
export async function clearOldHistory() {
|
||||||
const db = getProdAppDB()
|
const db = getProdAppDB()
|
||||||
try {
|
try {
|
||||||
const expired = await logs.automations.getExpiredLogs()
|
const expired = await automations.logs.getExpiredLogs()
|
||||||
const toDelete = expired.data.map((doc: any) => ({
|
const toDelete = expired.data.map((doc: any) => ({
|
||||||
_id: doc.id,
|
_id: doc.id,
|
||||||
_rev: doc.value.rev,
|
_rev: doc.value.rev,
|
||||||
|
|
Loading…
Reference in New Issue