@earth-app/collegedb
    Preparing search index...

    Function withKVTimeout

    • Wraps a KV store so each call rejects with KV_TIMEOUT when it runs past timeoutMs.

      The inner call is not cancelled, because Workers KV cannot abort a request. A timed-out write can still land. A timeout rejects; it never resolves with null or an empty value. Optional bulk methods exist on the wrapper only when the inner store has them.

      The wrapper is cached per store and limit, so re-initializing with the same store keeps the same identity and the mapper caches keyed on it survive.

      Parameters

      • kv: KVStorage

        Store to wrap

      • timeoutMs: number

        Per-call limit in milliseconds; a non-positive or non-finite value returns kv unchanged

      Returns KVStorage

      The wrapped store

      1.4.0