> For the complete documentation index, see [llms.txt](https://boxlang.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/scheduler/schedulerrestart.md).

# SchedulerRestart

Restart a scheduler by name.

The default will do a graceful shutdown, but if the force argument is set to true, it will force shutdown the scheduler.

If the timeout argument is set, it will wait for the specified amount of time in seconds before forcing the shutdown. The default is 30 seconds.

## Method Signature

```
SchedulerRestart(name=[string], force=[boolean], timeout=[integer])
```

### Arguments

| Argument  | Type      | Required | Description                                                                                    | Default |
| --------- | --------- | -------- | ---------------------------------------------------------------------------------------------- | ------- |
| `name`    | `string`  | `true`   | The name of the scheduler to restart.                                                          |         |
| `force`   | `boolean` | `false`  | If true, will force restart the scheduler. Default is false.                                   | `false` |
| `timeout` | `integer` | `false`  | The timeout in seconds to wait for the scheduler to restart gracefully. Default is 30 seconds. | `30`    |

## Examples

### Restart a scheduler

```java
schedulerNew( "restartSched", 2 );
schedulerRestart( "restartSched" );
writeOutput( "restarted" );

```

Result: restarted

## Related

* [SchedulerGet](/boxlang-language/reference/built-in-functions/scheduler/schedulerget.md)
* [SchedulerGetAll](/boxlang-language/reference/built-in-functions/scheduler/schedulergetall.md)
* [SchedulerList](/boxlang-language/reference/built-in-functions/scheduler/schedulerlist.md)
* [SchedulerNew](/boxlang-language/reference/built-in-functions/scheduler/schedulernew.md)
* [SchedulerShutdown](/boxlang-language/reference/built-in-functions/scheduler/schedulershutdown.md)
* [SchedulerStart](/boxlang-language/reference/built-in-functions/scheduler/schedulerstart.md)
* [SchedulerStats](/boxlang-language/reference/built-in-functions/scheduler/schedulerstats.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/scheduler/schedulerrestart.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
