Whether the current job is canceled
@param \gplcart\core\models\Job $job_model
@return boolean
324846
public function isCanceledJob($job_model)
    {
        $cancel_job_id = $this->getQuery('cancel_job');

        if (empty($cancel_job_id)) {
            return false;
        }

        $job_model->delete($cancel_job_id);
        return true;
    }
674113
public function actionSchedulerDelete($id)
    {
        $job = Scheduler::findOne($id);

        if ($job) {
            return $job->delete();
        }

        return false;
    }
971222
public boolean cancelJob(String slaveJobId) {
        final AnalysisResultFuture resultFuture = _runningJobs.remove(slaveJobId);
        if (resultFuture != null) {
            resultFuture.cancel();
            return true;
        }
        return false;
    }
750022
function excuteJob(){
  let job = peekNextJob();
  let nextJob;

  while(!!job && (job.excuteTime()-Date.now())<accuracy){
    job.run();
    queue.pop();

    let nextTime = job.nextTime();

    if(nextTime === null){
      delete map[job.id];
    }else{
      queue.offer({id:job.id, time: nextTime});
    }
    job = peekNextJob();
  }

  //If all the job have been canceled
  if(!job)
    return;

  //Run next schedule
  setTimer(job);
}
436897
def job_is_enabled(self, job_id):
		
		job_id = normalize_job_id(job_id)
		job_desc = self._jobs[job_id]
		return job_desc['enabled']
133605
public function getWidgetJob($job_model, $job = null)
    {
        if (!isset($job)) {
            $job = $job_model->get($this->getQuery('job_id', ''));
        }

        $rendered = '';

        if (!empty($job['status'])) {
            $job += array('widget' => 'common/job');
            $rendered = $this->render($job['widget'], array('job' => $job));
        }

        return $rendered;
    }
145956
public function release( $job ) {
		$data  = array(
			'job'         => serialize( $job ),
			'attempts'    => $job->attempts(),
			'reserved_at' => null,
		);
		$where = array(
			'id' => $job->id(),
		);

		if ( $this->database->update( $this->jobs_table, $data, $where ) ) {
			return true;
		}

		return false;
	}
1326626
def mark_job_as_canceling(self, job_id):
        

        job, _ = self._update_job_state(job_id, State.CANCELING)
        return job
777287
public boolean deleteJob (final JobKey jobKey) throws SchedulerException
  {
    validateState ();

    boolean result = false;

    final ICommonsList <? extends ITrigger> triggers = getTriggersOfJob (jobKey);
    for (final ITrigger trigger : triggers)
    {
      if (!unscheduleJob (trigger.getKey ()))
      {
        final StringBuilder sb = new StringBuilder ().append ("Unable to unschedule trigger [")
                                                     .append (trigger.getKey ())
                                                     .append ("] while deleting job [")
                                                     .append (jobKey)
                                                     .append ("]");
        throw new SchedulerException (sb.toString ());
      }
      result = true;
    }

    result = m_aResources.getJobStore ().removeJob (jobKey) || result;
    if (result)
    {
      notifySchedulerThread (0L);
      notifySchedulerListenersJobDeleted (jobKey);
    }
    return result;
  }
1129326
public function delete(Job $job)
    {
        $result = false;
        try {
            $res = $this->_queue->deleteMessage($job->getInstance()->getReceiptHandle());
            $result = $res->isSucceed();
        } catch (\Exception $e) {
            $this->eventsManager->fire('listener:logger', $this, '删除Queue消息失败:' . $e->getMessage());
        } finally {
            return $result;
        }
    }
1241290
public function failure( $job, Exception $exception ) {
		$insert = $this->database->insert( $this->failures_table, array(
			'job'       => serialize( $job ),
			'error'     => $this->format_exception( $exception ),
			'failed_at' => $this->datetime(),
		) );

		if ( $insert ) {
			$this->delete( $job );

			return true;
		}

		return false;
	}
452220
public function cancelAllNotStartedChildJobs(Job $job)
    {
        if (!$job->isRoot() || !$job->getChildJobs()) {
            return;
        }

        foreach ($job->getChildJobs() as $childJob) {
            if (in_array($childJob->getStatus(), $this->getNotStartedJobStatuses(), true)) {
                $this->cancelChildJob($childJob);
            }
        }
    }
388049
public function cancel($id, $table)
    {
        if ($this->service->cancel($id, $table)) {
            return back()->with('message', 'The job was successfully cancelled');
        }

        return back()->withErrors('Failed to cancel the job');
    }
755322
public function run()
    {
        $now = time();

        if ($this->remainingCoolDown() > 0) {
            return false;
        }

        $this->cache->forever($this->cacheKey, $now);

        $counter = 0;
        foreach ($this->jobs as $name => $jobBag) {
            $job = $this->getOrMake($name);

            $key = $this->makeCacheKey($name);

            $executed = null;
            if ($this->cache->has($key)) {
                $executed = $this->cache->get($key);

                if ($now - $executed < $job->getInterval() * 60) {
                    continue;
                }
            }

            if ($job->getActive()) {
                $now = time();

                $job->run($executed);
                $this->cache->forever($key, $now);
                $counter++;
            }
        }

        return $counter;
    }
402057
public boolean isScheduled(final org.easybatch.core.job.Job job) throws JobSchedulerException {
        String jobName = job.getName();
        try {
            return scheduler.checkExists(TriggerKey.triggerKey(TRIGGER_NAME_PREFIX + jobName));
        } catch (SchedulerException e) {
            throw new JobSchedulerException(format("Unable to check if the job '%s' is scheduled", jobName), e);
        }
    }
975312
def JobDueToRun(self, job):
    
    if not job.enabled:
      return False

    if job.forced_run_requested:
      return True

    now = rdfvalue.RDFDatetime.Now()

    if (job.last_run_time is not None and
        job.last_run_time + job.frequency > now):
      return False

    # No currently executing job - lets go.
    if not job.current_run_id:
      return True

    # There is a job executing but we allow overruns.
    if job.allow_overruns:
      return True

    return False
877488
def _cancel_job(self, job, force):
        """"""
        import streamsx.st as st
        if st._has_local_install:
            return st._cancel_job(job.id, force,
                domain_id=job.get_instance().get_domain().id, instance_id=job.get_instance().id)
        return False