# JanitorTask methods

## getConfig( key ) <a href="#getconfig" id="getconfig"></a>

Gets a configuration value.

* **`key`** The configuration key

**Returns:** The configuration value.

## init

Initializes the JanitorTask, called automatically when the JanitorTask is loaded. Contains any specific initialization for the task. Intended to be overloaded by specific tasks when needed.

**Returns:** A boolean specifying whether the JanitorTask was initialized ok or failed.

## run( baseTimestamp )

Performs the tasks for what this JanitorTask is meant. Must be overloaded by a higher level JanitorTask class.

* **`baseTimestamp`** The base timestamp to use for time-based calculations when running this task. Usually, now.

**Returns:** An array with the following values:

* One of the [`JANITORTASK_EXECUTION_RETURN_?`](/reference/core-modules/janitor.md#constants) available constants indicating the result of the task execution.
* The description of the task result, or a hash array of information on the result of the task execution.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cherrycake.tin.cat/reference/core-classes/janitortask/janitortask-methods.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
