---
title: "PollingTaskRunner.InterruptActiveTask"
description: "Interrupt the active task by canceling its lease extension and reporting it as failed."
image: "https://tilebox.com/images/tilebox-docs-social-preview.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://tilebox.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# PollingTaskRunner.InterruptActiveTask

import { Fragment } from "astro/jsx-runtime";

import ApiReference from "@docs/components/ApiReference.astro";

import ParamField from "@docs/components/ParamField.astro";

```go
func (*PollingTaskRunner) InterruptActiveTask(ctx context.Context) error
```

Interrupt the active task by canceling its lease extension and reporting it as failed.

If there is no active task, the method returns nil.

## Parameters

**ctx**

type: context.Context

required: true

The context used to report the interrupted task.

## Returns

An error if the active task could not be reported as failed.

<h2 id="request-example">Usage example</h2>

```go
if err := runner.InterruptActiveTask(ctx); err != nil {
    return err
}
```

Source: https://tilebox.com/docs/api-reference/go/workflows/PollingTaskRunner.InterruptActiveTask/index.mdx
