shouldRun method
Check if the provided task invocation should run.
Returns true if it should, false otherwise.
Implementation
@override
FutureOr<bool> shouldRun(TaskInvocation invocation) async {
if (await cache.hasInvocationChanged(invocation)) return true;
final lastTime = await cache.getLatestInvocationTime(invocation.name);
if (lastTime == null) {
return true;
}
return clock.now().isAfter(lastTime.add(period));
}