docs-v2/content/flux/v0/stdlib/influxdata/influxdb/tasks/lastsuccess.md

1.7 KiB

title description menu weight
tasks.lastSuccess() function `tasks.lastSuccess()` returns the time of the last successful run of the InfluxDB task or the value of the `orTime` parameter if the task has never successfully run.
flux_v0_ref
name parent identifier
tasks.lastSuccess influxdata/influxdb/tasks influxdata/influxdb/tasks/lastSuccess
301

tasks.lastSuccess() returns the time of the last successful run of the InfluxDB task or the value of the orTime parameter if the task has never successfully run.

Function type signature
(orTime: A) => time where A: Timeable

{{% caption %}} For more information, see Function type signatures. {{% /caption %}}

Parameters

orTime

({{< req >}}) Default time value returned if the task has never successfully run.

Examples

Return the time an InfluxDB task last successfully ran

import "influxdata/influxdb/tasks"

tasks.lastSuccess(orTime: 2020-01-01T00:00:00Z)