@budibase/backend-core 2.12.9 → 2.12.11
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 +8 -64
- package/dist/index.js.map +4 -4
- package/dist/index.js.meta.json +1 -1
- package/dist/package.json +4 -4
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +0 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/objectStore/utils.js +6 -1
- package/dist/src/objectStore/utils.js.map +1 -1
- package/dist/src/queue/inMemoryQueue.d.ts +1 -1
- package/dist/src/queue/inMemoryQueue.js +1 -1
- package/dist/src/queue/inMemoryQueue.js.map +1 -1
- package/dist/src/queue/queue.js +2 -15
- package/dist/src/queue/queue.js.map +1 -1
- package/dist/src/utils/index.d.ts +0 -1
- package/dist/src/utils/index.js +0 -1
- package/dist/src/utils/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +0 -1
- package/src/objectStore/utils.ts +5 -1
- package/src/queue/inMemoryQueue.ts +1 -1
- package/src/queue/queue.ts +3 -17
- package/src/utils/index.ts +0 -1
- package/dist/src/utils/Duration.d.ts +0 -30
- package/dist/src/utils/Duration.js +0 -48
- package/dist/src/utils/Duration.js.map +0 -1
- package/src/utils/Duration.ts +0 -49
- package/src/utils/tests/Duration.spec.ts +0 -19
package/dist/index.js
CHANGED
|
@@ -3336,8 +3336,12 @@ var init_utils3 = __esm({
|
|
|
3336
3336
|
PLUGINS: environment_default.PLUGIN_BUCKET_NAME
|
|
3337
3337
|
};
|
|
3338
3338
|
bbTmp = (0, import_path.join)((0, import_os.tmpdir)(), ".budibase");
|
|
3339
|
-
|
|
3339
|
+
try {
|
|
3340
3340
|
import_fs2.default.mkdirSync(bbTmp);
|
|
3341
|
+
} catch (e) {
|
|
3342
|
+
if (e.code !== "EEXIST") {
|
|
3343
|
+
throw e;
|
|
3344
|
+
}
|
|
3341
3345
|
}
|
|
3342
3346
|
}
|
|
3343
3347
|
});
|
|
@@ -5607,8 +5611,6 @@ __export(src_exports, {
|
|
|
5607
5611
|
DEFAULT_TENANT_ID: () => DEFAULT_TENANT_ID,
|
|
5608
5612
|
DeprecatedViews: () => DeprecatedViews,
|
|
5609
5613
|
DocumentType: () => DocumentType,
|
|
5610
|
-
Duration: () => Duration,
|
|
5611
|
-
DurationType: () => DurationType,
|
|
5612
5614
|
EmailUnavailableError: () => EmailUnavailableError,
|
|
5613
5615
|
ErrorCode: () => ErrorCode,
|
|
5614
5616
|
FeatureDisabledError: () => FeatureDisabledError,
|
|
@@ -7326,8 +7328,6 @@ var import_events2 = __toESM(require("events"));
|
|
|
7326
7328
|
// src/utils/index.ts
|
|
7327
7329
|
var utils_exports3 = {};
|
|
7328
7330
|
__export(utils_exports3, {
|
|
7329
|
-
Duration: () => Duration,
|
|
7330
|
-
DurationType: () => DurationType,
|
|
7331
7331
|
clearCookie: () => clearCookie,
|
|
7332
7332
|
compare: () => compare,
|
|
7333
7333
|
getAppIdFromCtx: () => getAppIdFromCtx,
|
|
@@ -7512,51 +7512,6 @@ function validEmail(value) {
|
|
|
7512
7512
|
);
|
|
7513
7513
|
}
|
|
7514
7514
|
|
|
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
7515
|
// src/queue/inMemoryQueue.ts
|
|
7561
7516
|
function newJob(queue, message) {
|
|
7562
7517
|
return {
|
|
@@ -7572,7 +7527,7 @@ var InMemoryQueue = class {
|
|
|
7572
7527
|
* @param opts This is not used by the in memory queue as there is no real use
|
|
7573
7528
|
* case when in memory, but is the same API as Bull
|
|
7574
7529
|
*/
|
|
7575
|
-
constructor(name, opts) {
|
|
7530
|
+
constructor(name, opts = null) {
|
|
7576
7531
|
this._name = name;
|
|
7577
7532
|
this._opts = opts;
|
|
7578
7533
|
this._messages = [];
|
|
@@ -7794,9 +7749,7 @@ function logging(queue, jobQueue) {
|
|
|
7794
7749
|
|
|
7795
7750
|
// src/queue/queue.ts
|
|
7796
7751
|
init_timers2();
|
|
7797
|
-
var
|
|
7798
|
-
var QUEUE_LOCK_RENEW_INTERNAL_MS = Duration.fromSeconds(30).toMs();
|
|
7799
|
-
var CLEANUP_PERIOD_MS = Duration.fromSeconds(60).toMs();
|
|
7752
|
+
var CLEANUP_PERIOD_MS = 60 * 1e3;
|
|
7800
7753
|
var QUEUES = [];
|
|
7801
7754
|
var cleanupInterval;
|
|
7802
7755
|
async function cleanup2() {
|
|
@@ -7806,14 +7759,7 @@ async function cleanup2() {
|
|
|
7806
7759
|
}
|
|
7807
7760
|
function createQueue(jobQueue, opts = {}) {
|
|
7808
7761
|
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
|
-
};
|
|
7762
|
+
const queueConfig = redisProtocolUrl || { redis: redisOpts };
|
|
7817
7763
|
let queue;
|
|
7818
7764
|
if (!environment_default.isTest()) {
|
|
7819
7765
|
queue = new import_bull.default(jobQueue, queueConfig);
|
|
@@ -12819,8 +12765,6 @@ var init8 = (opts = {}) => {
|
|
|
12819
12765
|
DEFAULT_TENANT_ID,
|
|
12820
12766
|
DeprecatedViews,
|
|
12821
12767
|
DocumentType,
|
|
12822
|
-
Duration,
|
|
12823
|
-
DurationType,
|
|
12824
12768
|
EmailUnavailableError,
|
|
12825
12769
|
ErrorCode,
|
|
12826
12770
|
FeatureDisabledError,
|