You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//if task status changed, update instance status also
@@ -341,7 +340,7 @@ function handle_housekeeping(task, cb) {
341
340
});
342
341
}
343
342
344
-
functionhandle_requested(task,next){
343
+
asyncfunctionhandle_requested(task,next){
345
344
346
345
constnow=newDate();
347
346
letinitialState=task.status;
@@ -352,13 +351,13 @@ function handle_requested(task, next) {
352
351
//WARNING - don't run anything asynchrnous after checking for task.start_date before I save the task with new start_date
353
352
if(task.start_date){
354
353
letstarting_for=now-task.start_date;
355
-
console.log("start_date is set",starting_for);
354
+
//console.log("start_date is set", starting_for);
356
355
if(starting_for<1000*60*30){
357
356
console.log("job seems to be still starting.. for "+starting_for);
358
357
task.status_msg="Job poked at "+now.toLocaleString()+" but job is still starting.. for "+starting_for/1000+"secs";
359
358
returnnext();
360
359
}
361
-
console.error("start_date is set on requested job, but it's been a while... guess it failed to start but didn't have start_date cleared.. proceeding?");
360
+
//console.error("start_date is set on requested job, but it's been a while... guess it failed to start but didn't have start_date cleared.. proceeding?");
362
361
}
363
362
364
363
//check if remove_date has not been reached (maybe set by request_task_removal got overridden)
@@ -393,7 +392,7 @@ function handle_requested(task, next) {
393
392
task.fail_date=newDate();
394
393
returnnext();
395
394
}
396
-
395
+
397
396
//fail the task if any dependency is removed
398
397
if(removed_deps.length>0){
399
398
console.debug("dependency removed.. failing this task");
@@ -402,7 +401,7 @@ function handle_requested(task, next) {
402
401
task.fail_date=newDate();
403
402
returnnext();
404
403
}
405
-
404
+
406
405
//fail if requested for too long
407
406
varreqtime=now-(task.request_date||task.create_date);//request_date may not be set for old task
408
407
if(reqtime>1000*3600*24*20){
@@ -418,84 +417,85 @@ function handle_requested(task, next) {
418
417
//when dependency finished, it should auto-poke this task. so it's okay for this to be long
419
418
task.next_date=newDate(Date.now()+1000*3600*24);
420
419
returnnext();
421
-
}
420
+
}
422
421
423
422
//set start date before checking for resource_select to prevent this task from getting double processed
423
+
//also make sure we get correct count for running/starting task in score_resource
0 commit comments