Skip to content

sensor_service.list_value() doesn't return all the keys macthing the prefix #5171

Closed
@anirudhbagri

Description

@anirudhbagri

SUMMARY

Inside a PollingSensor, I am trying to fetch all the key from a datastore which starts with a prefix 'entity_' like this:

self.sensor_service.list_value(prefix="entity_")

However, if the datastore contains several (or at least more than 100, that I could test) the method doesn't return all the keys.
Is there a pagination here? If yes, how can we get the entire list in one go? Or at least fetch the next set of keys?

STACKSTORM VERSION

st2 3.3.0, on Python 3.6.9

OS, environment, install method

Post what OS you are running this on, along with any other relevant information/

Linux

Steps to reproduce the problem

Use any sensor, store 100+ keys with the same prefix in the datastore.
Next, try to fetch all the keys stored with the same prefix.

Expected Results

I expect to get a list of all the keys that have the common prefix or have a way to get the entire list.

Actual Results

The code mentioned didn't return all the keys that were expected.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions