Open skewty opened 2 months ago
history values are enumerated regardless of boolean value passed
history values are enumerated only when boolean value is true
nats-py 2.8.0 nats-server 2.10.17
No response
import asyncio import logging import nats from nats.js.api import KeyValueConfig, StorageType from nats.js.errors import BucketNotFoundError async def run() -> None: nc = await nats.connect("tls://demo.nats.io:4443") jc = nc.jetstream() try: kv = await jc.key_value('nats_test') except BucketNotFoundError: kv = await jc.create_key_value(KeyValueConfig('nats_test', storage=StorageType.FILE)) await kv.put('test_key', b'test') logger.info("Watching config started") include_history = True try: while True: async for entry in await kv.watchall(include_history=include_history, inactive_threshold=2**10): logger.info(f"Change for {entry}") include_history = False except BaseException: logger.exception("Error watching config") raise finally: logger.info("Watching config exiting") logging.basicConfig(level=logging.INFO) logger = logging.getLogger('nats.testing') asyncio.run(run())
Also see #580 and #583
Is there any way to watch a value in the current code base? I tried watch(">") and watchall() and neither stay running. They exit shortly after giving me the value from history. Kinda renders the feature useless
Observed behavior
history values are enumerated regardless of boolean value passed
Expected behavior
history values are enumerated only when boolean value is true
Server and client version
nats-py 2.8.0 nats-server 2.10.17
Host environment
No response
Steps to reproduce
Also see #580 and #583