Skip to content

Commit 973e77b

Browse files
committed
Add docs for expiration
1 parent 394711e commit 973e77b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

docs/source/includes/_guide.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,12 +617,26 @@ if err != nil {
617617

618618
### Automatically expiring finished workflow instances
619619

620+
This differs for different backend implementations.
621+
622+
#### SQLite & MySQL
623+
624+
```go
625+
client.StartAutoExpiration(ctx context.Context, delay time.Duration)
626+
```
627+
628+
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.
629+
630+
<div style="clear: both"></div>
631+
632+
#### Redis
633+
620634
```go
621635
b, err := redis.NewRedisBackend(redisClient, redis.WithAutoExpiration(time.Hour * 48))
622636
// ...
623637
```
624638

625-
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.
639+
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.
626640

627641
## Logging
628642

0 commit comments

Comments
 (0)