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

Set expiration on detector_data #3

Open
saugereau opened this issue Apr 6, 2020 · 0 comments
Open

Set expiration on detector_data #3

saugereau opened this issue Apr 6, 2020 · 0 comments

Comments

@saugereau
Copy link

saugereau commented Apr 6, 2020

wouldn't it be interesting to set a TTL on detector data

def put_detector_data(self, path, data):
        key = self.__detector_key_for(path)
        self.get_storage().set(key, json.dumps(data))

as it was done on put

 def put(self, path, bytes):
        storage = self.get_storage()
        storage.set(path, bytes)
        storage.expireat(
            path, datetime.now() + timedelta(
                seconds=self.context.config.STORAGE_EXPIRATION_SECONDS
            )
        )
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