Skip to content

Commit

Permalink
Merge pull request #362 from cschleiden/expiration-docs
Browse files Browse the repository at this point in the history
Add docs for expiration
  • Loading branch information
cschleiden authored Aug 9, 2024
2 parents 394711e + 973e77b commit b024a1b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/source/includes/_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -617,12 +617,26 @@ if err != nil {

### Automatically expiring finished workflow instances

This differs for different backend implementations.

#### SQLite & MySQL

```go
client.StartAutoExpiration(ctx context.Context, delay time.Duration)
```

When you call this on a client, a workflow will be started in the `system` queue that will periodically run and remove finished workflow instances that are older than the specified delay.

<div style="clear: both"></div>

#### Redis

```go
b, err := redis.NewRedisBackend(redisClient, redis.WithAutoExpiration(time.Hour * 48))
// ...
```

For now this is only supported for the Redis backend. When an `AutoExpiration` is passed to the backend, finished workflow instances will be automatically removed after the specified duration. This works by setting a TTL on the Redis keys for finished workflow instances. If `AutoExpiration` is set to `0` (the default), no TTL will be set.
When an `AutoExpiration` is passed to the backend, finished workflow instances will be automatically removed after the specified duration. This works by setting a TTL on the Redis keys for finished workflow instances. If `AutoExpiration` is set to `0` (the default), no TTL will be set.

## Logging

Expand Down

0 comments on commit b024a1b

Please sign in to comment.