R
Railway2y ago
echan

is there any way to indefinitely suspend a service?

Without removing a deployment, I just want to turn off a service to test it locally (the deployment would interfere with it if I test local). I don't see an option to do this. Am I missing something?
32 Replies
Percy
Percy2y ago
Project ID: N/A
echan
echanOP2y ago
N/A
Percy
Percy2y ago
Brody
Brody2y ago
there is no such feature, only removing deployment but i will say if your local tests can interfere with the app running on railway, youre doing something wrong
echan
echanOP2y ago
It's a discord bot. The only way I can test is by it connecting with Discord's API, so both of them have real effects.
Brody
Brody2y ago
then you want a test bot and a prod bot
echan
echanOP2y ago
If I remove a deployment, do I basically have to push a dummy commit to the GitHub repo to redeploy?
Brody
Brody2y ago
yes ^
echan
echanOP2y ago
In that case I'd have to set up a whole new bot and its token, which is definitely the best practice but I'm too lazy for that haha But I suppose I should
Brody
Brody2y ago
you should, ruining tests with the main (production) bot token is big bad
Fragly
Fragly2y ago
I recommend this too here's a good way to do it, or at least how I do it so i have a bat file which basically starts the bot in my bot i have the bot check for a certain file which I've .gitignored if it finds it i know it's running locally, so I then switch out the bot token with my test bot token otherwise if it can't find it ( it's running from railway ) then i use the main bot's token so running the bat file will run it on my test bot and running the same command on railway ( npm start ) will run the test bot
Brody
Brody2y ago
lol
Fragly
Fragly2y ago
idk if this is standard, and idk if there's a better way but that's how I do it and it works for me
Brody
Brody2y ago
in my bots code i check RAILWAY_ENVIRONMENT == "production" if so it will use the production token, otherwise it will use local token fragly is kinda doing the same thing, but in a very round-about way
Fragly
Fragly2y ago
what's RAILWAY_ENVIRONMENT? is that something in env?
Fragly
Fragly2y ago
dang that's neat, the reason I'm not doing something like that btw is because I might want to host the main bot locally in that case I just remove the file ( named dev )
echan
echanOP2y ago
Ah okay gotcha I just hate messing with token stuff, but I suppose I will go ahead and do that Thank you guys :)
Fragly
Fragly2y ago
npp
Brody
Brody2y ago
i can run my bot locally and on railway, the code handles token switching by itself, the above was pseudo code
Fragly
Fragly2y ago
oh okay
echan
echanOP2y ago
Right so you just hotswap the token when running locally? Yeah that's not that difficult really then
Brody
Brody2y ago
yep basically, super easy, way easier than checking for a file
Fragly
Fragly2y ago
yea fair point I'll keep my file though sunglas
Brody
Brody2y ago
disk access go brrr
Fragly
Fragly2y ago
hehe
echan
echanOP2y ago
Discord permissions are just insanely annoying to fiddle with Or I'm just dumb
Fragly
Fragly2y ago
wdyym, it's just checkboxes
Brody
Brody2y ago
por qué no los dos
echan
echanOP2y ago
Yeah but I always forget which permissions are necessary for my bot So I just check admin usually lol
Fragly
Fragly2y ago
fair, normally I just make the bot admin when it's like a dedicated bot for a server yea
Adam
Adam2y ago
Hopping in here to say that it is possible, remove the latest deployment and turn off the branch trigger in settings New deployments won't be made if the branch trigger is off
Want results from more Discord servers?
Add your server