Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/job-manager/lib/JobManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const setTimeoutPromise = util.promisify(setTimeout);
const fastq = require('fastq');
const later = require('@breejs/later');
const Bree = require('bree');
const pWaitFor = require('p-wait-for').default;
const { UnhandledJobError, IncorrectUsageError } = require('@tryghost/errors');
const logging = require('@tryghost/logging');
const isCronExpression = require('./is-cron-expression');
Expand Down Expand Up @@ -426,7 +427,6 @@ class JobManager {

logging.warn('Waiting for busy job in inline job queue');

const { default: pWaitFor } = await import('p-wait-for');
await pWaitFor(() => this.inlineQueue.idle() === true, options);

logging.warn('Inline job queue finished');
Expand Down
3 changes: 3 additions & 0 deletions packages/job-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@
"date-fns": "4.4.0",
"rewire": "9.0.1",
"sinon": "catalog:"
},
"engines": {
"node": "^22.12.0 || >=24.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/webhook-mock-receiver/lib/WebhookMockReceiver.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { AssertionError } = require('assert');
const { URL } = require('url');
const nock = require('nock');
const pWaitFor = require('p-wait-for').default;
class WebhookMockReceiver {
constructor({ snapshotManager }) {
this.snapshotManager = snapshotManager;
Expand All @@ -14,7 +15,6 @@ class WebhookMockReceiver {

async receivedRequest() {
// @NOTE: figure out a better waiting mechanism here, don't allow it to hang forever
const { default: pWaitFor } = await import('p-wait-for');
await pWaitFor(() => this._receiver.isDone());
}

Expand Down
5 changes: 4 additions & 1 deletion packages/webhook-mock-receiver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
"p-wait-for": "6.0.0"
},
"devDependencies": {
"got": "14.6.6",
"got": "15.1.0",
"sinon": "catalog:"
},
"engines": {
"node": "^22.12.0 || >=24.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ const assert = require('assert/strict');
const sinon = require('sinon');

const WebhookMockReceiver = require('../');
const got = require('got').default;

describe('Webhook Mock Receiver', function () {
let snapshotManager;
let webhookMockReceiver;
let got;
const webhookURL = 'https://test-webhook-receiver.com/webhook';

beforeAll(async function () {
got = (await import('got')).default;
beforeAll(function () {
snapshotManager = {
assertSnapshot: sinon.spy(),
};
Expand Down
47 changes: 2 additions & 45 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.