Node.js Discord bot with Repl DB keeps getting stuck, can't force-quit it

Question:

I don’t know what’s happening, but after some recent changes I made, my code is stuck in an infinite loop. I don’t even know where the infinite loop is, or what it’s doing. It worked fine just a week ago.

I can’t stop the execution either, which makes troubleshooting way harder than it should be.

Repl link: https://replit.com/@JapanYoshi/QuipOfTheDay

There’s also not a lot of code that should be running, but either the CPU or RAM usage is consistently at 100%.

To force quit a Repl and stop any processes, enter kill 1 in the shell. CPU and RAM usage can be inaccurately tracked, and regardless, hitting 100% isn’t usually an issue.

3 Likes

My guess is that its waiting for a network request. Try using ctrl-c and seeing where it complains (e.g. HEEEEY YOU PRESSED CTRL-C, THAT’S AN ERROR AT LINE 23974324)

2 Likes

Update: I reviewed the code and found that a utility function wasn’t getting imported. I have no idea why it didn’t just print a runtime error saying that, but it’s fixed now.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.