process.exit() & manual restarts not working

2 years ago

Hi, I have process.exit() in my script to force restarts and it doesn't seem to be triggering restarts, manually doing it from the dashboard is also 50/50

Closed

39 Replies

2 years ago

c874129c-de81-442a-86fc-4749b499194b


2 years ago

one of many projects with the same issue


maddsua
HOBBY

2 years ago

What's the service restart policy? I believe it's set to on failure by default, and calling process.exit() with no exit code isn't considered to be abnormal exit by any of the stdlibs


maddsua
HOBBY

2 years ago

This dropdown right here

1324897953822806058


maddsua
HOBBY

2 years ago

Make sure it's set to Always, or call process.exit(1) instead


2 years ago

I always set mine to always


2 years ago

So I don’t think it’s that


2 years ago

But I can try process.exit(1)


maddsua
HOBBY

2 years ago

You can also try setting up health checks, services are restarted automatically when those fail


2 years ago

I’ll give it a look!


2 years ago

hmmm we don't have passive healthchecks though


maddsua
HOBBY

2 years ago

I was referring to http health checks tho


2 years ago

<:monkaS:620823495844036618>


2 years ago

I know, we don't do passive healthchecks so there's no restarting


maddsua
HOBBY

2 years ago

wat


maddsua
HOBBY

2 years ago

wait so those health checks are only for the first 5 or so seconds after the deploy goes live to ensure that the app has started?


maddsua
HOBBY

2 years ago

<:spongebobbruh:901282271057813504>


2 years ago

yes exactly


maddsua
HOBBY

2 years ago

<:spongebobbruh:901282271057813504>


2 years ago

what?


2 years ago

Isn’t it still weird that my manual restarts sometimes don’t work though?


2 years ago

I’ll try (1)


2 years ago

For process exit


2 years ago

But it still doesn’t quite explain why manual restarts don’t work


2 years ago

what makes you say manual restarts dont work?


2 years ago

I’m clicking restart and my script doesn’t budge


2 years ago

that's not really conclusive evidence unfortunately


2 years ago

my script logs on startup


2 years ago

It isn’t restarting


2 years ago

Not sure how else to show it


2 years ago

we would need a minimal reproducible example with steps to reproduce


2 years ago

Ok, I can look into that


2 years ago

it needs to be a crashing code. I have done this before so it needs to be process.exit(1)


2 years ago

it should just restart itself (sometimes it takes a few seconds)


2 years ago

if not what i normlaly do is to trigger a redeploy through the Dashboard or just git commit --allow-empty lol


2 years ago

it's like y'all don't even know my template exists -


2 years ago

I didn’t 🥲


prantor0010
TRIAL

2 years ago

cv,


2 years ago

does it work for your needs?


Welcome!

Sign in to your Railway account to join the conversation.

Loading...