33 Replies
Project ID:
cbf50408-4c4f-4a5e-adcf-0f5cdbd02b69
cbf50408-4c4f-4a5e-adcf-0f5cdbd02b69
read some tutorials watch some YouTube videos, etc. I apologize but these threads are not for us to teach you how to program
I have seen no videos on this, I went to the docs and saw how to add redis variables. I didn't see their value in the railway docs that is why I'm here
If you have reference(s) just paste it and I will follow
add a redis plugin, then setup the variable references in your service, then use the environment variables in your code to connect
Wow thanks, but please one more, the redis plugins is on the railway platform where my app is hosted, or I should add it as an npm package in my app?
you would need to add the redis database plugin to your project on railway, to connect to the redis database you would need to use a package to connect to redis
Wow, this is now sounding kind of difficult, is there any reference online you could point to me so that I can follow. Cause in the docs I didn't see the plugins and database setups as steps before implementing redis
it's not difficult, you might just be overthinking it
as for how to use redis, that's something you will have to learn yourself, as I said above these threads are not for us to teach you how to program
Mr Brody I'm not asking how to program. I'm asking how to use your services
^
That's why I'm asking for references
have you added a redis database plugin to your project yet?
Ok. Thanks I was working on it before I became too frustrated and shutdown my system
I will follow your instructions
If any issues I will come back
Thanks 🙏
?
...
I think it's like 3 button pushes to add the database plugin to your project...
Ok, when I put on my system I will follow up your instructions
Thanks again
Mr Brody one last question
Can I ask?
sure
Ok I understand what you started earlier as this thread is not for programming tutorial.
I have a timing function that performs an action every minute. After I make changes in my app and redeploy it to railway, my timer stops. I want it to continue after the redeployment. Is redis the solution? If not suggest for me let me read the solution. I know I can solve it
once you redoploy your old code gets removed and replaced with the new code, why wouldn't the new code just start another timer when it starts up?
When a user is approved in my app by admin, a record will be created in the database for every minute for seven minutes. When I make a change my code will check my tracking time and know the time remaining then complete the action. But when I make a change and redeploy it in railway the record created will be more than seven. Then I started looking online for solutions before coming across redis
nah you just want to store the date stamp on initial creation and check it against the current date whenever you access the data, you shouldn't need timers or anything like that
Here you go again, you just humbled me that I have more to know. I thought about it cause the issue might be coming from the time zones
speaking of time zones, you should be doing all the date stamps and time calculations in UTC, and only convert out to the users local time zone for display purposes
But why I need timer is because at the end of the seven minutes from the time of approval, the user gets an email
So I started looking for what will keep my process running even after my app is restarted on railway
sounds like you need another service to hand tasks off to
If I didn't make changes and the app didn't restart. At exactly seven minutes the whole process will work
But if I make changes and redeploy my work, the problem I explained will occur
yep you need some kind of external worker or task queue
there's plenty of tutorials floating around the internet for that
But this is not redis?
Thanks
yeah there's workers that save state into a redis database
Okay, I'll take it from here
Thanks for your help
sounds good
no problem