@fedify/postgres 2.1.27 → 2.1.28

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
@@ -286,10 +286,15 @@ var PostgresMessageQueue = class {
286
286
  }
287
287
  /**
288
288
  * Initializes the message queue table if it does not already exist.
289
+ * Concurrent calls share one initialization attempt. If it fails, a later
290
+ * call retries initialization.
289
291
  */
290
292
  initialize() {
291
293
  if (this.#initialized) return Promise.resolve();
292
- return this.#initPromise ??= this.#doInitialize();
294
+ return this.#initPromise ??= this.#doInitialize().catch((error) => {
295
+ this.#initPromise = void 0;
296
+ throw error;
297
+ });
293
298
  }
294
299
  async #doInitialize() {
295
300
  logger.debug("Initializing the message queue table {tableName}...", { tableName: this.#tableName });
package/dist/mq.d.cts CHANGED
@@ -72,6 +72,8 @@ declare class PostgresMessageQueue implements MessageQueue {
72
72
  listen(handler: (message: any) => void | Promise<void>, options?: MessageQueueListenOptions): Promise<void>;
73
73
  /**
74
74
  * Initializes the message queue table if it does not already exist.
75
+ * Concurrent calls share one initialization attempt. If it fails, a later
76
+ * call retries initialization.
75
77
  */
76
78
  initialize(): Promise<void>;
77
79
  /**
package/dist/mq.d.ts CHANGED
@@ -72,6 +72,8 @@ declare class PostgresMessageQueue implements MessageQueue {
72
72
  listen(handler: (message: any) => void | Promise<void>, options?: MessageQueueListenOptions): Promise<void>;
73
73
  /**
74
74
  * Initializes the message queue table if it does not already exist.
75
+ * Concurrent calls share one initialization attempt. If it fails, a later
76
+ * call retries initialization.
75
77
  */
76
78
  initialize(): Promise<void>;
77
79
  /**
package/dist/mq.js CHANGED
@@ -283,10 +283,15 @@ var PostgresMessageQueue = class {
283
283
  }
284
284
  /**
285
285
  * Initializes the message queue table if it does not already exist.
286
+ * Concurrent calls share one initialization attempt. If it fails, a later
287
+ * call retries initialization.
286
288
  */
287
289
  initialize() {
288
290
  if (this.#initialized) return Promise.resolve();
289
- return this.#initPromise ??= this.#doInitialize();
291
+ return this.#initPromise ??= this.#doInitialize().catch((error) => {
292
+ this.#initPromise = void 0;
293
+ throw error;
294
+ });
290
295
  }
291
296
  async #doInitialize() {
292
297
  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.1.27",
3
+ "version": "2.1.28",
4
4
  "description": "PostgreSQL drivers for Fedify",
5
5
  "keywords": [
6
6
  "fedify",
@@ -74,14 +74,14 @@
74
74
  },
75
75
  "peerDependencies": {
76
76
  "postgres": "^3.4.7",
77
- "@fedify/fedify": "^2.1.27"
77
+ "@fedify/fedify": "^2.1.28"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@std/async": "npm:@jsr/std__async@^1.0.13",
81
81
  "tsdown": "^0.21.6",
82
82
  "typescript": "^6.0.0",
83
83
  "@fedify/fixture": "^2.0.0",
84
- "@fedify/testing": "^2.1.27"
84
+ "@fedify/testing": "^2.1.28"
85
85
  },
86
86
  "scripts": {
87
87
  "build:self": "tsdown",