Redis db and timeout

Adding redis time out and connection for DB.

Tried to keep it in the same format as before