process.exit() & manual restarts not working

a year 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

39 Replies

a year ago

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


a year ago

one of many projects with the same issue


maddsua
HOBBY

a year 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

a year ago

This dropdown right here

1324897953822806000


maddsua
HOBBY

a year ago

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


a year ago

I always set mine to always


a year ago

So I don’t think it’s that


a year ago

But I can try process.exit(1)


maddsua
HOBBY

a year ago

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


a year ago

I’ll give it a look!


a year ago

hmmm we don't have passive healthchecks though


maddsua
HOBBY

a year ago

I was referring to http health checks tho


a year ago

<:monkaS:620823495844036618>


a year ago

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


maddsua
HOBBY

a year ago

wat


maddsua
HOBBY

a year 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

a year ago

<:spongebobbruh:901282271057813504>


a year ago

yes exactly


maddsua
HOBBY

a year ago

<:spongebobbruh:901282271057813504>


a year ago

what?


a year ago

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


a year ago

I’ll try (1)


a year ago

For process exit


a year ago

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


a year ago

what makes you say manual restarts dont work?


a year ago

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


a year ago

that's not really conclusive evidence unfortunately


a year ago

my script logs on startup


a year ago

It isn’t restarting


a year ago

Not sure how else to show it


a year ago

we would need a minimal reproducible example with steps to reproduce


a year ago

Ok, I can look into that


a year ago

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


a year ago

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


a year ago

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


a year ago

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


a year ago

I didn’t 🥲


prantor0010
TRIAL

a year ago

cv,


a year ago

does it work for your needs?


Loading...