IKatsuba / serverless-redis

2 stars 0 forks source link

[Improvement] Sleepy apps on Railway #7

Open btnalexandre opened 1 month ago

btnalexandre commented 1 month ago

Hello @IKatsuba,

Do you think it would be possible to adapt this package so that the connection to the Redis instance only takes place when an http request is made, or to set a timeout so that the connection closes after a certain time without any interaction with the http service?

The fact that the http service is permanently connected to the Redis instance means that apps cannot be switched to sleep mode on Railway.

Some things than can prevent a service from being put to sleep -

Keeping active database connections open, such as a database connection pooler.

https://docs.railway.app/reference/app-sleeping

Thanks !

IKatsuba commented 1 month ago

@btnalexandre hey!

Oh, this is a good point to support sleepy mode for serverless-redis!