watson-developer-cloud / botkit-middleware

A middleware to connect Watson Conversation Service to different chat channels using Botkit
https://www.npmjs.com/package/botkit-middleware-watson
Apache License 2.0
207 stars 257 forks source link

Make sure Watson Assistant context has an expiry value (Redis storage) #211

Closed younes-io closed 4 years ago

younes-io commented 4 years ago

Hello,

As WA pushes/updates the context in Redis storage via sendToWatson and updateContext, I need a way to make sure this context TTL is only 24 hours (if the context gets updated, the TTL is updated to 24h again).

I know Redis provides EXPIRE and SETEX commands, but I'm not sure how to "plug it into" the Watson Botkit Middleware as it is the one storing/updating the context behind the scenes...

Any ideas ?

Naktibalda commented 4 years ago

Storage is not a concern of Watson Assistant middleware.

I made pull request to botbuilder-storage-redis, but it hasn't been released yet, so I am using my own fork from private npm repository,.

younes-io commented 4 years ago

@Naktibalda : the TLL is set on the key on both key creation and key update, right ?

Naktibalda commented 4 years ago

It's the same SET call in both cases.

younes-io commented 4 years ago

Yes, I realized you perform a setex command