@fedify/postgres 2.5.0-dev.2364 → 2.5.0-dev.2378

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/mq.cjs CHANGED
@@ -311,10 +311,15 @@ var PostgresMessageQueue = class {
311
311
  }
312
312
  /**
313
313
  * Initializes the message queue table if it does not already exist.
314
+ * Concurrent calls share one initialization attempt. If it fails, a later
315
+ * call retries initialization.
314
316
  */
315
317
  initialize() {
316
318
  if (this.#initialized) return Promise.resolve();
317
- return this.#initPromise ??= this.#doInitialize();
319
+ return this.#initPromise ??= this.#doInitialize().catch((error) => {
320
+ this.#initPromise = void 0;
321
+ throw error;
322
+ });
318
323
  }
319
324
  async #doInitialize() {
320
325
  logger.debug("Initializing the message queue table {tableName}...", { tableName: this.#tableName });
package/dist/mq.d.cts CHANGED
@@ -74,6 +74,8 @@ declare class PostgresMessageQueue implements MessageQueue {
74
74
  listen(handler: (message: any) => void | Promise<void>, options?: MessageQueueListenOptions): Promise<void>;
75
75
  /**
76
76
  * Initializes the message queue table if it does not already exist.
77
+ * Concurrent calls share one initialization attempt. If it fails, a later
78
+ * call retries initialization.
77
79
  */
78
80
  initialize(): Promise<void>;
79
81
  /**
package/dist/mq.d.ts CHANGED
@@ -74,6 +74,8 @@ declare class PostgresMessageQueue implements MessageQueue {
74
74
  listen(handler: (message: any) => void | Promise<void>, options?: MessageQueueListenOptions): Promise<void>;
75
75
  /**
76
76
  * Initializes the message queue table if it does not already exist.
77
+ * Concurrent calls share one initialization attempt. If it fails, a later
78
+ * call retries initialization.
77
79
  */
78
80
  initialize(): Promise<void>;
79
81
  /**
package/dist/mq.js CHANGED
@@ -306,10 +306,15 @@ var PostgresMessageQueue = class {
306
306
  }
307
307
  /**
308
308
  * Initializes the message queue table if it does not already exist.
309
+ * Concurrent calls share one initialization attempt. If it fails, a later
310
+ * call retries initialization.
309
311
  */
310
312
  initialize() {
311
313
  if (this.#initialized) return Promise.resolve();
312
- return this.#initPromise ??= this.#doInitialize();
314
+ return this.#initPromise ??= this.#doInitialize().catch((error) => {
315
+ this.#initPromise = void 0;
316
+ throw error;
317
+ });
313
318
  }
314
319
  async #doInitialize() {
315
320
  logger.debug("Initializing the message queue table {tableName}...", { tableName: this.#tableName });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/postgres",
3
- "version": "2.5.0-dev.2364+4d9b5f4d",
3
+ "version": "2.5.0-dev.2378+fea9c751",
4
4
  "description": "PostgreSQL drivers for Fedify",
5
5
  "keywords": [
6
6
  "fedify",
@@ -71,7 +71,7 @@
71
71
  },
72
72
  "peerDependencies": {
73
73
  "postgres": "^3.4.7",
74
- "@fedify/fedify": "^2.5.0-dev.2364+4d9b5f4d"
74
+ "@fedify/fedify": "^2.5.0-dev.2378+fea9c751"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@js-temporal/polyfill": "^0.5.1",
@@ -79,7 +79,7 @@
79
79
  "tsdown": "^0.22.0",
80
80
  "typescript": "^6.0.0",
81
81
  "@fedify/fixture": "^2.0.0",
82
- "@fedify/testing": "^2.5.0-dev.2364+4d9b5f4d"
82
+ "@fedify/testing": "^2.5.0-dev.2378+fea9c751"
83
83
  },
84
84
  "scripts": {
85
85
  "build:self": "tsdown",