grammyjs / storages

Storage adapters for grammY sessions.
51 stars 29 forks source link

Add TTL #52

Closed Satont closed 2 years ago

Satont commented 2 years ago

It's possible to add TTL check on read operations for all adapters.

KnorpelSenf commented 2 years ago

Would you want to make use of the expiry feature of storages like Redis, or rather perform the checks manually in all cases?

This may combine well with https://github.com/grammyjs/grammY/issues/188 if the latter approach is chosen.

Satont commented 2 years ago

Would you want to make use of the expiry feature of storages like Redis, or rather perform the checks manually in all cases?

This may combine well with grammyjs/grammY#188 if the latter approach is chosen.

Only redis has expire in existed adapters as i know, so i'd like to implement it on read.

KnorpelSenf commented 2 years ago

I agree with that. I also think it's good to add features like that directly to the session plugin so that not every adapter has to reimplement the logic. If you think so too, we could transfer the issue to the core repo.

Loskir commented 2 years ago

Not relevant anymore, I suppose? https://github.com/grammyjs/grammY/issues/247

KnorpelSenf commented 2 years ago

Not relevant anymore, I suppose? grammyjs/grammY#247

Correct.