Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't expire KV store: "TypeError: 'set' object does not support indexing" #9

Open
m3adow opened this issue Jun 12, 2018 · 0 comments

Comments

@m3adow
Copy link

m3adow commented Jun 12, 2018

I'm trying to implement a disk KV store into my already existing and working pipeline with an SQLStore, to speed up response times.
The Readme states to use settings.pipeline.expire to manually expire the KV, as it's not expiring automatically.

I'm not 100% certain what this is supposed to mean, as this method does not exist, but I assumed cass.configuration.settings.expire_sinks() is meant. As I only want to expire the KV store, I tried to manually expire it:

""" Cass has been initialized with both datastores and some more stuff, like expirations """

    for sink in cass.configuration.settings.pipeline._sinks:
        if isinstance(sink, cassiopeia_diskstore.SimpleKVDiskStore):
            print("Expiring cass KV sink.")
            sink.expire()

But I get an error:

Traceback (most recent call last):
  File "C:/app/zero_usage_tester.py", line 19, in <module>
    expire_disk_store()
  File "C:/app/zero_usage_tester.py", line 15, in expire_disk_store
    sink.expire()
  File "c:\venv\src\cassiopeia-diskstore\cassiopeia-diskstore\cassiopeia_diskstore\__init__.py", line 63, in expire
    store = sinks[0]._store
TypeError: 'set' object does not support indexing

The error seems to be here:

sinks = {sink for many_sinks in self._sinks.values() for sink in many_sinks}

Am I doing something wrong? What would be the best practice?
and/or
Is my assumption of this bug correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant