checkForUpdate method

void checkForUpdate()

Calls update rate-limited to once per updateDuration.

Implementation

void checkForUpdate() {
  DateTime now = DateTime.now();
  if (updated != null && now.isBefore(updated.add(updateDuration))) return;
  updated = now;
  update(this);
}