Marks a task as deleted.
424679
def task_delete(self, **kw):
        

        id, task = self.get_task(**kw)

        if task['status'] == Status.DELETED:
            raise ValueError("Task is already deleted.")

        self._execute(id, 'delete')
        return self.get_task(uuid=task['uuid'])[1]
482623
def done(self, msg_handle):
        """"""
        self.sqs_client.delete_message(
            QueueUrl=self.queue_url,
            ReceiptHandle=msg_handle.handle,
        )
178649
def task_del(self, t):
        
        name = t._name
        if name in self._tasknames:
            del self._tasknames[name]
        self._tasks.discard(t)
        self._tasks_scoped.discard(t)
        try:
            t.stop()
        except:
            log = self._params.get('log', self._discard)
            log.error("Failed to stop processes for task %r -- %s", name, e, exc_info=log.isEnabledFor(logging.DEBUG))
        for pid in t.get_pids():
            self.proc_del(pid)
166147
def terminate(self):
        
        log = self._params.get('log', self._discard)
        self._dnr = time.time()
        self.stop()
        log.info("Task '%s' marked for death", self._name)
515574
function discardIfOverAttempted(tasksByName, count) {
      if (tasksByName) {
        taskUtils.getTasks(tasksByName).forEach(task => {
          const n = task.discardIfOverAttempted(maxNumberOfAttempts, true);
          if (count) overAttempted += n;
        });
      }
    }
1248795
def on_success(self, retval, task_id, args, kwargs):
        
        key = self._get_cache_key(args, kwargs)
        if cache.get(key) is not None:
            cache.delete(key)
            logger.debug('Penalty for the task %s has been removed.' % self.name)

        return super(PenalizedBackgroundTask, self).on_success(retval, task_id, args, kwargs)
945250
public void checkDeleteHistoricTaskInstance(HistoricTaskInstanceEntity task) {
    // deleting unexisting historic task instance should be silently ignored
    // see javaDoc HistoryService.deleteHistoricTaskInstance
    if (task != null) {
      if (task.getProcessDefinitionKey() != null) {
        getAuthorizationManager().checkAuthorization(DELETE_HISTORY, PROCESS_DEFINITION, task.getProcessDefinitionKey());
      }
    }
  }
125294
def do_shutdown (self):
        """"""
        with self.mutex:
            unfinished = self.unfinished_tasks - len(self.queue)
            self.queue.clear()
            if unfinished <= 0:
                if unfinished < 0:
                    raise ValueError('shutdown is in error')
                self.all_tasks_done.notifyAll()
            self.unfinished_tasks = unfinished
            self.shutdown = True
964630
def mark_deactivated(self,request,queryset):
        """"""
        rows_updated = queryset.update(Active=False, End=datetime.date.today() )
        if rows_updated == 1:
            message_bit = "1 cage was"
        else:
            message_bit = "%s cages were" % rows_updated
        self.message_user(request, "%s successfully marked as deactivated." % message_bit)
1365054
def action_delete(self, courseid, taskid, path):
        
        # normalize
        path = path.strip()
        if not path.startswith("/"):
            path = "/" + path

        wanted_path = self.verify_path(courseid, taskid, path)
        if wanted_path is None:
            return self.show_tab_file(courseid, taskid, _("Internal error"))

        # special case: cannot delete current directory of the task
        if "/" == wanted_path:
            return self.show_tab_file(courseid, taskid, _("Internal error"))

        try:
            self.task_factory.get_task_fs(courseid, taskid).delete(wanted_path)
            return self.show_tab_file(courseid, taskid)
        except:
            return self.show_tab_file(courseid, taskid, _("An error occurred while deleting the files"))
63294
function deleteTasks(_ref12, tasks) {
    var state = _ref12.state,
        commit = _ref12.commit,
        dispatch = _ref12.dispatch,
        rootState = _ref12.rootState;
    dispatch('SET_TASKS', null);
    return makeRequest(commit, rootState.c3s.client.apis.Tasks.delete_tasks, {
      tasks: tasks
    }, 'c3s/task/SET_TASKS');
  }
1272723
public void markCompleted() throws IOException {
    if (disableHistory) {
      return;
    }
    fileManager.moveToDone(jobId, true, CoronaJobTracker.getMainJobID(jobId));
  }
866973
public void removeTask(ReceivedMessageTask task) {
        if (tasks.remove(task)) {
            task.cancelDeadlockFuture();
            if (listener != null) {
                listener.onTaskRemoved(this);
            }
        }
    }
800186
def delete_task(self, courseid, taskid):
        
        if not id_checker(courseid):
            raise InvalidNameException("Course with invalid name: " + courseid)
        if not id_checker(taskid):
            raise InvalidNameException("Task with invalid name: " + taskid)

        task_fs = self.get_task_fs(courseid, taskid)

        if task_fs.exists():
            task_fs.delete()
            get_course_logger(courseid).info("Task %s erased from the factory.", taskid)
237753
private void handleDelete() {
    log.debug(String.format("%s - Network configuration removed from cluster: %s", NetworkManager.this, cluster.address()));
    tasks.runTask(new Handler<Task>() {
      @Override
      public void handle(final Task task) {
        unready(new Handler<AsyncResult<Void>>() {
          @Override
          public void handle(AsyncResult<Void> result) {
            if (result.failed()) {
              log.error(result.cause());
            }
            if (currentContext != null) {
              log.info(String.format("%s - Undeploying network", NetworkManager.this));
              undeployNetwork(currentContext, new Handler<AsyncResult<Void>>() {
                @Override
                public void handle(AsyncResult<Void> result) {
                  if (result.failed()) {
                    log.error(result.cause());
                    task.complete();
                  } else {
                    // Once we've finished undeploying all the components of the
                    // network, set the network's status to nothing in order to
                    // indicate that the manager (this) can be undeployed.
                    data.put(currentContext.status(), "", new Handler<AsyncResult<String>>() {
                      @Override
                      public void handle(AsyncResult<String> result) {
                        if (result.failed()) {
                          log.error(result.cause());
                        } else {
                          log.info(String.format("%s - Successfully undeployed all components", NetworkManager.this));
                        }
                        task.complete();
                      }
                    });
                  }
                }
              });
            } else {
              task.complete();
            }
          }
        });
      }
    });
  }
319777
def remove_task(cls, task):
        
        with cls._lock:
            if not isinstance(task, Task):
                task = cls.resolved_task(task)

            if task:
                cls.tasks.remove(task)

            cls.tasks.sort()
187180
def on_deleted(self, event):
        """"""
        for delegate in self.delegates:
            if hasattr(delegate, "on_deleted"):
                delegate.on_deleted(event)