@budibase/backend-core 2.12.8 → 2.12.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5607,8 +5607,6 @@ __export(src_exports, {
5607
5607
  DEFAULT_TENANT_ID: () => DEFAULT_TENANT_ID,
5608
5608
  DeprecatedViews: () => DeprecatedViews,
5609
5609
  DocumentType: () => DocumentType,
5610
- Duration: () => Duration,
5611
- DurationType: () => DurationType,
5612
5610
  EmailUnavailableError: () => EmailUnavailableError,
5613
5611
  ErrorCode: () => ErrorCode,
5614
5612
  FeatureDisabledError: () => FeatureDisabledError,
@@ -7326,8 +7324,6 @@ var import_events2 = __toESM(require("events"));
7326
7324
  // src/utils/index.ts
7327
7325
  var utils_exports3 = {};
7328
7326
  __export(utils_exports3, {
7329
- Duration: () => Duration,
7330
- DurationType: () => DurationType,
7331
7327
  clearCookie: () => clearCookie,
7332
7328
  compare: () => compare,
7333
7329
  getAppIdFromCtx: () => getAppIdFromCtx,
@@ -7512,51 +7508,6 @@ function validEmail(value) {
7512
7508
  );
7513
7509
  }
7514
7510
 
7515
- // src/utils/Duration.ts
7516
- var DurationType = /* @__PURE__ */ ((DurationType2) => {
7517
- DurationType2["MILLISECONDS"] = "milliseconds";
7518
- DurationType2["SECONDS"] = "seconds";
7519
- DurationType2["MINUTES"] = "minutes";
7520
- DurationType2["HOURS"] = "hours";
7521
- DurationType2["DAYS"] = "days";
7522
- return DurationType2;
7523
- })(DurationType || {});
7524
- var conversion = {
7525
- milliseconds: 1,
7526
- seconds: 1e3,
7527
- minutes: 60 * 1e3,
7528
- hours: 60 * 60 * 1e3,
7529
- days: 24 * 60 * 60 * 1e3
7530
- };
7531
- var Duration = class _Duration {
7532
- static convert(from, to, duration) {
7533
- const milliseconds = duration * conversion[from];
7534
- return milliseconds / conversion[to];
7535
- }
7536
- static from(from, duration) {
7537
- return {
7538
- to: (to) => {
7539
- return _Duration.convert(from, to, duration);
7540
- },
7541
- toMs: () => {
7542
- return _Duration.convert(from, "milliseconds" /* MILLISECONDS */, duration);
7543
- }
7544
- };
7545
- }
7546
- static fromSeconds(duration) {
7547
- return _Duration.from("seconds" /* SECONDS */, duration);
7548
- }
7549
- static fromMinutes(duration) {
7550
- return _Duration.from("minutes" /* MINUTES */, duration);
7551
- }
7552
- static fromHours(duration) {
7553
- return _Duration.from("hours" /* HOURS */, duration);
7554
- }
7555
- static fromDays(duration) {
7556
- return _Duration.from("days" /* DAYS */, duration);
7557
- }
7558
- };
7559
-
7560
7511
  // src/queue/inMemoryQueue.ts
7561
7512
  function newJob(queue, message) {
7562
7513
  return {
@@ -7572,7 +7523,7 @@ var InMemoryQueue = class {
7572
7523
  * @param opts This is not used by the in memory queue as there is no real use
7573
7524
  * case when in memory, but is the same API as Bull
7574
7525
  */
7575
- constructor(name, opts) {
7526
+ constructor(name, opts = null) {
7576
7527
  this._name = name;
7577
7528
  this._opts = opts;
7578
7529
  this._messages = [];
@@ -7794,9 +7745,7 @@ function logging(queue, jobQueue) {
7794
7745
 
7795
7746
  // src/queue/queue.ts
7796
7747
  init_timers2();
7797
- var QUEUE_LOCK_MS = Duration.fromMinutes(5).toMs();
7798
- var QUEUE_LOCK_RENEW_INTERNAL_MS = Duration.fromSeconds(30).toMs();
7799
- var CLEANUP_PERIOD_MS = Duration.fromSeconds(60).toMs();
7748
+ var CLEANUP_PERIOD_MS = 60 * 1e3;
7800
7749
  var QUEUES = [];
7801
7750
  var cleanupInterval;
7802
7751
  async function cleanup2() {
@@ -7806,14 +7755,7 @@ async function cleanup2() {
7806
7755
  }
7807
7756
  function createQueue(jobQueue, opts = {}) {
7808
7757
  const { opts: redisOpts, redisProtocolUrl } = getRedisOptions();
7809
- const queueConfig = {
7810
- redis: redisProtocolUrl || redisOpts,
7811
- settings: {
7812
- maxStalledCount: 0,
7813
- lockDuration: QUEUE_LOCK_MS,
7814
- lockRenewTime: QUEUE_LOCK_RENEW_INTERNAL_MS
7815
- }
7816
- };
7758
+ const queueConfig = redisProtocolUrl || { redis: redisOpts };
7817
7759
  let queue;
7818
7760
  if (!environment_default.isTest()) {
7819
7761
  queue = new import_bull.default(jobQueue, queueConfig);
@@ -12819,8 +12761,6 @@ var init8 = (opts = {}) => {
12819
12761
  DEFAULT_TENANT_ID,
12820
12762
  DeprecatedViews,
12821
12763
  DocumentType,
12822
- Duration,
12823
- DurationType,
12824
12764
  EmailUnavailableError,
12825
12765
  ErrorCode,
12826
12766
  FeatureDisabledError,