updateIfOld method

String updateIfOld()

Implementation

String updateIfOld() {
  // return  _lock.synchronized(() async {
  if (apiKey == 'none') {
    log.severe('None apiKey sync');
    return 'error';
  }
  //
  // > check hive update needed
  //
  // final hive = await future();
  if (updatedAt.isBefore(DateTime.now().add(const Duration(hours: -2)))) {
    final hive = future();
    hive.put('sync_date_$apiKey$path',
        DateTime.now().add(const Duration(hours: -1, minutes: -59)));
    update();

    return 'updated';
  }

  return 'loaded';
  // });
}