How to stop running cloud job through code? Is any way to fetch running jobs and stop them?

I have running the cloud job with an infinite loop so that it will be up and running continuously. Like bot.
Moralis.Cloud.job(“chooseWinner”, async (request) => {
while(true){
// code
// sleep code
}
});
The job is running fine. but not able to find any way to stop that job. Even after restraining the server, it is showing running is the status board.

1 Like

I’ll test it later, I expect it to be how you say it is.