I ran this script in the background and it doesn't stop running and everything is slow, how do I stop it if I can't load any pages?

1231
Tera Contributor

find_real_file.png

var gr = new GlideRecord('sc_request');
gr.query();
while(gr.next()) {
gr.u_opened_for=gr.requested_for.getDisplayValue(); 
gr.setLimit(5);
gr.query(); gr.print();
//gr.update();
}
1 ACCEPTED SOLUTION

Your current instance node is looping the script. Until it is able to clear itself by timing out you will likely need to switch nodes.

Logout of your instance and clear your browser cache. Then do a fresh login and you should get a different node. If this doesn't work you can switch nodes via browser plugins like SN Utils.

View solution in original post

14 REPLIES 14

RudhraKAM
Tera Guru

Below are the steps to stop an already running scheduled job:

  • In the Navigation browser, open System Diagnostics > Active Transactions (all Nodes). This will open all the running scheduled jobs.
  • Select the job which you want to stop and select the "Kill" option, which will stop the job.

 

Setting the scheduled job to 'active = false' and deleting the scheduled job,will not stop it if it has already started.

1231
Tera Contributor

But it is not loading any pages, as the option Cancel after 4 hours is checked, will this script be canceled after 4 hours of execution?

Killing the transaction will work, but it is not immediate in the response. It sends the kill command but it will need to be processed 

Aman Kumar S
Kilo Patron

This is happening because request table will have a lot of records, instead break it down by running your code in batches.

var gr = new GlideRecord('sc_request');
gr.setLimit(5);
gr.query();
while(gr.next()) {
gr.u_opened_for=gr.requested_for; 
gr.update();
}
Best Regards
Aman Kumar