To utilize the KyselySemaphoreAdapter, you must install the "kysely" package and configure a Kysely class instance.

Note in order to use KyselySemaphoreAdapter correctly, ensure you use a single, consistent database across all server instances. The adapter have been tested with sqlite, postgres and mysql databases.

IMPORT_PATH: "@daiso-tech/core/semaphore/adapters"

Implements

Constructors

Methods

  • The updateExpiration updates the specified slot expiration as long as it is expireable and unexpired of the given semaphore.

    Parameters

    • key: string
    • slotId: string
    • expiration: Date

    Returns Promise<number>

    Returns a number greater than 0 if the slot expiration was updated, otherwise returns 0.